Saltar al contenido principal

Debi API (2022-08-01)

Download OpenAPI specification:Download

Introduction

Debi (formerly TuCuota) serves a REST API. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

The base URLs for the Debi API are:

Content types

Debi API supports only JSON content types. Make sure to include the following header on your requests.

Content-Type Header

Content-Type: "application/json"

Authentication

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

Get an API key

To create new API keys, please visit the developers section of our site.

For each environment (live and test) yo'll find two types of API Keys:

  • Publishable (pk_...): can be publicly-accessible in your web client-side code to tokenize payment information.
  • Secret (sk_...): To be used on the server-side. Must be secret and stored securely in your application's code to call Debi APIs.

To authenticate you must provide the API key in an Authorization request header (using the Bearer authentication scheme) when making API requests.

Example Authentication Header

Authorization: Bearer sk_live_...

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Errors

This API uses HTTP status codes to communicate with the API consumer.

  • 200 OK - Response to a successful GET, PUT, PATCH or DELETE.
  • 201 Created - Response to a POST that results in a creation.
  • 204 No Content - Response to a successful request that won't be returning a body (like a DELETE request).
  • 400 Bad Request - Malformed request.
  • 401 Unauthorized - When no or invalid authentication details are provided.
  • 403 Forbidden - When authentication succeeded but authenticated user doesn't have access to the resource.
  • 404 Not Found - When a non-existent resource is requested.
  • 405 Method Not Allowed - Method not allowed.
  • 406 Not Acceptable - Could not satisfy the request Accept header.
  • 415 Unsupported Media Type - Unsupported media type in request.
  • 422 Unprocessable Entity - Form validation errors.

Error response

This API returns both, machine-readable error codes and human-readable error messages when there's an error.

Example
Validation Error
{
  "message": "The given data was invalid.",
  "errors": {
    "organization_name": ["El campo debe tener algún valor."],
    "mobile_number": ["El campo debe tener algún valor."],
    "province": ["El campo debe tener algún valor."],
    "locality": ["El campo debe tener algún valor."],
    "address": ["El campo debe tener algún valor."]
  }
}
Generic Error
{
  "message": "Unauthenticated."
}

Idempotent Requests

The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. For example, if a request to create a payment does not respond due to a network connection error, you can retry the request with the same idempotency key to guarantee that no more than one charge is created.

To perform an idempotent request, provide an additional Idempotency-Key: <key> header to the request.

Idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors.

An idempotency key is a unique value generated by the client which the server uses to recognize subsequent retries of the same request. How you create unique keys is up to you, but we suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions.

Keys are eligible to be removed from the system after they're at least 24 hours old, and a new request is generated if a key is reused after the original has been pruned. The idempotency layer compares incoming parameters to those of the original request and errors unless they're the same to prevent accidental misuse.

Results are only saved if an API endpoint started executing. If incoming parameters failed validation, or the request conflicted with another that was executing concurrently, no idempotent result is saved because no API endpoint began execution. It is safe to retry these requests.

All POST requests accept idempotency keys. Sending idempotency keys in GET and DELETE requests has no effect and should be avoided, as these requests are idempotent by definition.

Metadata

The following objects have a metadata parameter that you can use this parameter to attach key-value data:

Metadata is useful for storing additional, structured information on an object.

Do not store any sensitive information (bank account numbers, card details, etc.) as metadata.

Pagination

All top-level API resources have support for bulk fetches via "list" API methods. For instance, you can list payments, list customers, and list subscriptions. These list API methods share a common structure, taking at least these three parameters: limit, starting_after, and ending_before.

The response of a list API method represents a single page in a reverse chronological stream of objects. If you do not specify starting_after or ending_before, you will receive the first page of this stream, containing the newest objects. You can specify starting_after equal to the object ID value of an item to retrieve the page of older objects occurring immediately after the named object in the reverse chronological stream. Similarly, you can specify ending_before to receive a page of newer objects occurring immediately before the named object in the stream. Objects in a page always appear in reverse chronological order. Only one of starting_after or ending_before may be used.

Request IDs

Each API request has an associated request identifier. You can find this value in the response headers, under Request-Id. You can also find request identifiers in the URLs of individual request logs in your Dashboard.

Conventions

Notational Conventions

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC2119.

HTTP Methods

This API uses HTTP verbs (methods) as following:

  • GET - Read - used to read (or retrieve) a representation of a resource,
  • POST - Create - used to create new resources. In particular, it's used to create subordinate resources.
  • PUT - Update/Replace - used for update capabilities, PUT-ing to a known resource URI with the request body containing the newly-updated representation of the original resource. On successful request, replaces identified resource with the request body.
  • PATCH - Update/Modify - used for modify capabilities. The PATCH request only needs to contain the changes to the resource, not the complete resource.
  • DELETE - Delete - used to delete a resource identified by a URI.

Representation of Date and Time

All exchange of date and time-related data MUST be done according to RFC339 standard.

Versioning

This API uses Api-Version header to identify requested version. Every minor version SHOULD be backward compatible. However, major versions MAY introduce breaking changes.

Api-Version:

This header SHOULD be present in every request. If not, API MUST use the newest available major release.

If requested version is not available, API SHOULD try to fall back to the next available minor release.

When backwards-incompatible changes are made to the API, a new, dated version is released. The current version of the API is 2022-02-14.

Resource IDs

This API uses short non-sequential url-friendly unique ids. Every resource id MUST consists of 12 url-friendly characters: A-Z, a-z, 0-9, _ and -.

Example

PY6b3Rr6nRMo

Testing Card and account 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.

Number Type Status Network Funding
4242424242424242 card approved visa credit
4000056655665556 card approved visa debit
4507990000004905 card approved visa credit
5555555555554444 card approved mastercard credit
5896570000000008 card approved mastercard credit
2223003122003222 card approved mastercard credit
5200828282828210 card approved mastercard debit
5105105105105100 card approved mastercard prepaid
6042451111111117 card approved discover credit
6011111111111117 card approved discover credit
6011000990139424 card approved discover credit
6011981111111113 card approved discover debit
5299910010000015 card approved discover credit
3056930009020004 card approved diners credit
36227206271667 card approved diners credit
3566002020360505 card approved jcb credit
378282246310005 card approved amex credit
371449635398431 card approved amex credit
4000000000005126 card submitted visa credit
4000000000003220 card submitted visa credit
5895622082273045 card approved naranja credit
5895622082273044 card rejected naranja credit
2859363672283668188432 cbu approved
3220001823000055910025 cbu approved
8258975011100070754947 cbu rejected
1212000002283668188432 cbu rejected
4000000000000002 card rejected visa credit
4338308001478538 card rejected visa credit
4000000000009995 card rejected visa credit
4000000000009987 card rejected visa credit
4000000000009979 card rejected visa credit
371449635398432 card rejected amex credit

If you create a payment method using number 4000000320000021, a payment_method.automatically_updated event will be dispatched mimicking a credit card renewal.

Webhook Notifications

Webhooks are endpoints you can configure to be notified about events that happen in your Debi account. Most users configure Webhooks from the dashboard, which provides a user interface for registering and testing your webhook endpoints.

Example webhook:
{
  "id": "EVPYeJeyeJ7r",
  "created_at": "2019-05-23T20:18:28-0300",
  "data": {
    "object": {
      "id": "CS9PL8eeo8aB",
      "paid": false,
      "amount": 1600,
      "status": "pending_submission",
      "gateway": "GWd1e9nQwK7v",
      "currency": "ARS",
      "customer": {
        "id": "CS9PL8eeo8aB",
        "name": "Máximo Irizarry",
        "email": "mirrizarry@paez.com",
        "livemode": true,
        "metadata": { "key": "value" },
        "created_at": "2018-05-01T11:45:14-0300",
        "updated_at": "2018-05-01T11:45:14-0300",
        "gateway_identifier": "001234",
        "mobile_number": "+5493812596655",
        "identification_type": "",
        "identification_number": ""
      },
      "livemode": true,
      "metadata": { "key": "value" },
      "retryable": false,
      "created_at": "2018-05-01T11:45:14-0300",
      "updated_at": "2018-05-01T11:45:14-0300",
      "charge_date": "2019-05-15",
      "description": "Pago extra",
      "subscription": null,
      "name": "Máximo Irizarry",
      "email": "mirrizarry@paez.com",
      "gateway_identifier": "456700",
      "mobile_number": "+5493812596655",
      "identification_type": "",
      "identification_number": ""
    }
  },
  "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

  • checkout.session.async_payment_failed
  • checkout.session.async_payment_succeeded
  • checkout.session.completed
  • checkout.session.expired
  • customer.created
  • customer.disabled
  • customer.restored
  • customer.updated
  • gateway.created
  • gateway.disabled
  • gateway.enabled
  • gateway.updated
  • import.processed
  • mandate.created
  • mandate.restored
  • mandate.revoked
  • payment.cancelled
  • payment.created
  • payment.retrying
  • payment.updated
  • payment_method.automatically_updated
  • payment_method.created
  • payment_method.updated
  • refund.approved
  • refund.created
  • refund.failed
  • subscription.automatically_paused
  • subscription.cancelled
  • subscription.created
  • subscription.finished
  • subscription.paused
  • subscription.resumed
  • subscription.updated
  • user.updated_available_brands

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 Debi can reach it with HTTP requests. If you’re working locally, the easiest way to do this is with ngrok.

Webhooks security

Debi signs the webhook events it sends to your endpoints by including a signature in each event’s Debi-Signature header. This allows you to verify that the events were sent by Debi, not by a third party.

Before you can verify signatures, you need to retrieve your endpoint’s secret "Secreto webhook" from your webhooks in our developers panel. Add or select the endpoint you want to obtain the secret for, then click the "mostrar" button.

Debi generates a unique secret key for each endpoint. If you use the same endpoint for both test and live API keys, note that the secret is different for each one. Additionally, if you use multiple endpoints, you must obtain a secret for each one you want to verify signatures on. After this setup, Debi starts to sign each webhook it sends to the endpoint.

Webhooks authenticity validation steps

Debi generates signatures using a hash-based message authentication code (HMAC) with SHA-256. To prevent downgrade attacks.

Step 1: Extract the timestamp and signatures from the header

Split the header, using the , character as the separator, to get a list of elements. Then split each element, using the = character as the separator, to get a prefix and value pair.

The value for the prefix t corresponds to the timestamp, and v1 corresponds to the signature (or signatures). You can discard all other elements.

Step 2: Prepare the signed_payload string

The signed_payload string is created by concatenating:

The timestamp (as a string) The character . The actual JSON payload (that is, the request body)

Step 3: Determine the expected signature

Compute an HMAC with the SHA256 hash function. Use the endpoint’s signing secret as the key, and use the signed_payload string as the message.

Step 4: Compare the signatures

Compare the signature (or signatures) in the header to the expected signature. For an equality match, compute the difference between the current timestamp and the received timestamp, then decide if the difference is within your tolerance.

To protect against timing attacks, use a constant-time string comparison to compare the expected signature to each of the received signatures.

Customers

This object represents a customer of your organization. It lets you create subscriptions and track payments that belong to the same customer.

id
required
string

Unique identifier for the Customer.

name
required
null or string

The customer's full name or business name.

email
required
null or string

The customer's email address.

object
required
string
Value: "customer"
livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

mobile_number
required
null or string

Customer's valid phone number (with area code).

default_payment_method_id
null or string
gateway_identifier
required
null or string

The customer's reference for bank account statements.

identification_number
required
null or string

Customer's Document ID number.

identification_type
required
null or string

Customer's Document type.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

deleted_at
required
null or string <date-time>

Time at which the object was deleted. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

{
  • "id": "CS3Z25Agp708",
  • "object": "customer",
  • "gateway_identifier": 1723393503,
  • "name": "Andrés Bahena Tercero",
  • "email": "andres37@calvillo.info",
  • "identification_type": null,
  • "identification_number": null,
  • "mobile_number": "+5481934863501",
  • "metadata": {
    },
  • "livemode": true,
  • "created_at": "2021-07-05T12:24:32-03:00",
  • "updated_at": "2021-07-05T12:24:32-03:00",
  • "deleted_at": null
}

List all customers

By default newest customers will be first on the list.

Authorizations:
SecretKeyAuthentication
query Parameters
all
boolean

Include archived records.

object (range_query_specs)

A filter on the list, based on the object created_at field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.

ending_before
string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

starting_after
string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response Schema: application/json
required
Array of objects (Customer)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/customers?all=SOME_BOOLEAN_VALUE&created_at=SOME_OBJECT_VALUE&ending_before=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&starting_after=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "links": {},
  • "meta": {}
}

Create a customer

Create a customer.

Authorizations:
SecretKeyAuthentication
Request Body schema: application/json
required
name
null or string

The customer's full name or business name.

email
null or string

The customer's email address.

gateway_identifier
null or string

The customer's reference for bank account statements.

identification_type
null or string

Customer's Document type.

identification_number
null or string

Customer's Document ID number.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Responses

Response Schema: application/json
object (Customer)

This object represents a customer of your organization.

id
required
string

Unique identifier for the Customer.

name
required
null or string

The customer's full name or business name.

email
required
null or string

The customer's email address.

object
required
string
Value: "customer"
livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

mobile_number
required
null or string

Customer's valid phone number (with area code).

default_payment_method_id
null or string
gateway_identifier
required
null or string

The customer's reference for bank account statements.

identification_number
required
null or string

Customer's Document ID number.

identification_type
required
null or string

Customer's Document type.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

deleted_at
required
null or string <date-time>

Time at which the object was deleted. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

Content type
application/json
{
  • "name": "Pedro Lombardo",
  • "email": "pedrolombardo@email.com",
  • "gateway_identifier": "1234",
  • "identification_type": "DNI",
  • "identification_number": "237767265",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a customer

Retrieve a customer.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: CS9PL8eeo8aB

Responses

Response Schema: application/json
object (Customer)

This object represents a customer of your organization.

id
required
string

Unique identifier for the Customer.

name
required
null or string

The customer's full name or business name.

email
required
null or string

The customer's email address.

object
required
string
Value: "customer"
livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

mobile_number
required
null or string

Customer's valid phone number (with area code).

default_payment_method_id
null or string
gateway_identifier
required
null or string

The customer's reference for bank account statements.

identification_number
required
null or string

Customer's Document ID number.

identification_type
required
null or string

Customer's Document type.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

deleted_at
required
null or string <date-time>

Time at which the object was deleted. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

curl --request GET \
  --url https://api.debi.pro/v1/customers/CS9PL8eeo8aB \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update a customer

Update a customer.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: CS9PL8eeo8aB
Request Body schema: application/json
required
name
null or string

The customer's full name or business name.

email
null or string

The customer's email address.

gateway_identifier
null or string

The customer's reference for bank account statements.

identification_type
null or string

Customer's Document type.

identification_number
null or string

Customer's Document ID number.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Responses

Response Schema: application/json
object (Customer)

This object represents a customer of your organization.

id
required
string

Unique identifier for the Customer.

name
required
null or string

The customer's full name or business name.

email
required
null or string

The customer's email address.

object
required
string
Value: "customer"
livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

mobile_number
required
null or string

Customer's valid phone number (with area code).

default_payment_method_id
null or string
gateway_identifier
required
null or string

The customer's reference for bank account statements.

identification_number
required
null or string

Customer's Document ID number.

identification_type
required
null or string

Customer's Document type.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

deleted_at
required
null or string <date-time>

Time at which the object was deleted. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

Content type
application/json
{
  • "name": "Pedro Lombardo",
  • "email": "pedrolombardo@email.com"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Archive a customer

Archive the customer and cancel subscriptions and payments in process.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: CS9PL8eeo8aB

Responses

Request samples

curl --request POST \
  --url https://api.debi.pro/v1/customers/CS9PL8eeo8aB/actions/archive \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "message": "Archived successfully"
}

Restore a customer

Immediately restore the customer.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: CS9PL8eeo8aB

Responses

Request samples

curl --request POST \
  --url https://api.debi.pro/v1/customers/CS9PL8eeo8aB/actions/restore \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "message": "Restored successfully"
}

Search customers

Search customers.

Authorizations:
SecretKeyAuthentication
query Parameters
q
required
string
Example: q=john doe

The search query string. See search query language and the list of supported query fields for charges.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

page
required
string
Example: page=john doe

A cursor for pagination across multiple pages of results. Don’t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.

Responses

Response Schema: application/json
required
Array of objects (Customer)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/customers/search?q=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&page=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Events

Events are our way of letting you know when something interesting happens in your account. When an interesting event occurs, we create a new Event object. For example, when a payment updates, we create a payment.updated event. Note that many API requests may cause multiple events to be created. For example, if you create a new subscription for a customer, you will receive both a customer.subscription.created event and a payment.created event.

Los eventos ocurren cuando cambia el estado de otro recurso API. El estado del recurso al momento del cambio está embebido en el campo data del evento. Por ejemplo, un evento de payment.updated contendrá un pago y un evento customer.created contendrá un cliente.

id
string

Unique identifier for the Event.

object
string
Value: "event"
created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

object
delivered_at
null or string <date-time>

Time at which the event was delivered. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

resource
string
Enum: "customer" "gateway" "import" "mandate" "payment" "payment_method" "subscription"

Resource attached to the event.

resource_id
string

ID for the resource attached to the event.

type
string
Enum: "checkout.session.async_payment_failed" "checkout.session.async_payment_succeeded" "checkout.session.completed" "checkout.session.expired" "customer.created" "customer.disabled" "customer.restored" "customer.updated" "gateway.created" "gateway.disabled" "gateway.enabled" "gateway.updated" "import.processed" "mandate.created" "mandate.restored" "mandate.revoked" "payment.cancelled" "payment.created" "payment.retrying" "payment.updated" "payment_method.automatically_updated" "payment_method.created" "payment_method.updated" "refund.approved" "refund.created" "refund.failed" "subscription.automatically_paused" "subscription.cancelled" "subscription.created" "subscription.finished" "subscription.paused" "subscription.resumed" "subscription.updated" "user.updated_available_brands"

Event type.

{
  • "created_at": "2022-02-05T01:42:13-03:00",
  • "data": {
    },
  • "delivered_at": "2022-02-11T20:11:38-03:00",
  • "id": "EVaX3JagwR6x",
  • "livemode": true,
  • "object": "event",
  • "resource": "customer",
  • "resource_id": "CSnlZxyY3jwr",
  • "type": "customer.created"
}

List events

Returns a cursor-paginated list of your events.

Authorizations:
SecretKeyAuthentication
query Parameters
delivery_success
boolean

Filter events by whether all webhooks were successfully delivered. If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned.

related_object
string <= 255 characters
Example: related_object=CS9PL8eeo8aB

Filters events for a single object. Can receive any ID.

type
string <= 255 characters

A string containing a specific event name, or group of events using * as a wildcard. The list will be filtered to include only events with a matching event property.

object (range_query_specs)

A filter on the list, based on the object created_at field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.

ending_before
string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

starting_after
string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response Schema: application/json
Array of objects (Event)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/events?delivery_success=SOME_BOOLEAN_VALUE&related_object=SOME_STRING_VALUE&type=SOME_STRING_VALUE&created_at=SOME_OBJECT_VALUE&ending_before=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&starting_after=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "links": {},
  • "meta": {}
}

Retrieve an event

Retrieve an event.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: EVaX3JagwR6x

Responses

Response Schema: application/json
object (Event)

This object represents an event of your account.

id
string

Unique identifier for the Event.

object
string
Value: "event"
created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

object
delivered_at
null or string <date-time>

Time at which the event was delivered. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

resource
string
Enum: "customer" "gateway" "import" "mandate" "payment" "payment_method" "subscription"

Resource attached to the event.

resource_id
string

ID for the resource attached to the event.

type
string
Enum: "checkout.session.async_payment_failed" "checkout.session.async_payment_succeeded" "checkout.session.completed" "checkout.session.expired" "customer.created" "customer.disabled" "customer.restored" "customer.updated" "gateway.created" "gateway.disabled" "gateway.enabled" "gateway.updated" "import.processed" "mandate.created" "mandate.restored" "mandate.revoked" "payment.cancelled" "payment.created" "payment.retrying" "payment.updated" "payment_method.automatically_updated" "payment_method.created" "payment_method.updated" "refund.approved" "refund.created" "refund.failed" "subscription.automatically_paused" "subscription.cancelled" "subscription.created" "subscription.finished" "subscription.paused" "subscription.resumed" "subscription.updated" "user.updated_available_brands"

Event type.

Request samples

curl --request GET \
  --url https://api.debi.pro/v1/events/EVaX3JagwR6x \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Gateways

A gateway is a institution that authorizes and facilitates payments. It can be a payment processor, a bank, or a card network. In Debi, the gateway object represents the specific configuration and credentials that your company uses to access each service.

approved_at
string <date-time>

Time at which the gateway was marked as approved. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

code_length
null or number

Code length

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

disabled
boolean

Whether the gateway is disabled.

id
string

Unique identifier for the Gateway.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

number
string

Merchant identifier.

number_bank_retries
null or number

Number Bank Retries.

object
string
Value: "gateway"
provider
string
Enum: "amex" "bac" "banamex" "banistmo" "banorte" "cabal" "cbu-bind" "cbu-galicia" "cbu-patagonia" "favacard" "fiserv-argentina" "fiserv-mexico" "mercado-pago" "naranja" "payway" "prisma-visa" "prisma-visa-debit" "prisma-mastercard" "wompi"

Provider.

object

Supported payment methods for this Gateway.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

username
string

Gateway current username.

{
  • "approved_at": "2023-02-14T11:41:40-03:00",
  • "code_length": null,
  • "created_at": "2023-01-31T16:18:31-03:00",
  • "disabled": false,
  • "id": "GWM8DK6VKoG3",
  • "livemode": false,
  • "number": "1203764444",
  • "number_bank_retries": null,
  • "object": "gateway",
  • "provider": "mercado-pago",
  • "supported_payment_methods": {
    },
  • "updated_at": "2023-02-01T16:36:06-03:00",
  • "username": "user@name.com"
}

List Gateways

Returns a list of all your gateways.

Authorizations:
SecretKeyAuthentication
query Parameters
ending_before
string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

starting_after
string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response Schema: application/json
required
Array of objects (Gateway)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/gateways?ending_before=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&starting_after=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {}
}

Imports

An Import is an object which contains data to be created in Debi. As these objects may be big, they will be created and processed later. You can check the status of the import.

id
string

Unique identifier for the Import.

batch_job
object
cancelled_at
null or string <date-time>

Time at which the import was marked as cancelled. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

invalid_at
null or string <date-time>

Time at which the import was marked as invalid. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

processed_at
null or string <date-time>

Time at which the import was marked as processed. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

ready_at
null or string <date-time>

Time at which the import was marked as ready. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

invalid_rows_count
number

Invalid Rows Count

valid_rows_count
number

Valid Rows Count

rows_count
number

Rows Count

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

original_filename
string
type
string

Import Type

status
string

Import Status

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

{
  • "batch_job": {
    },
  • "cancelled_at": null,
  • "created_at": "2021-06-08T09:49:04-03:00",
  • "id": "IMB1rRDqkM5X",
  • "invalid_at": null,
  • "invalid_rows_count": 0,
  • "livemode": true,
  • "original_filename": "subscriptions-import-template.csv",
  • "processed_at": "2021-06-08T09:49:06-03:00",
  • "ready_at": "2021-06-08T09:49:05-03:00",
  • "rows_count": 2,
  • "status": "processed",
  • "type": "subscriptions",
  • "updated_at": "2021-06-08T09:49:06-03:00",
  • "valid_rows_count": 2
}

List Imports

Returns a list of all your imports.

Authorizations:
SecretKeyAuthentication
query Parameters
search
string
Example: search=foo@bar.com

Search.

status
string
Example: status=ready

Allowed values: pending, ready, invalid, cancelled, processing, processed.

object (range_query_specs)

A filter on the list, based on the object created_at field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.

ending_before
string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

starting_after
string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response Schema: application/json
required
Array of objects (Import)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/imports?search=SOME_STRING_VALUE&status=SOME_STRING_VALUE&created_at=SOME_OBJECT_VALUE&ending_before=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&starting_after=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {}
}

Create a import

Create a import.

Authorizations:
SecretKeyAuthentication
Request Body schema: application/json
required
type
string
filename
string
original_filename
string
auto
boolean
metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Responses

Response Schema: application/json
object (Import)

This object represents an import of your account.

id
string

Unique identifier for the Import.

batch_job
object
cancelled_at
null or string <date-time>

Time at which the import was marked as cancelled. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

invalid_at
null or string <date-time>

Time at which the import was marked as invalid. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

processed_at
null or string <date-time>

Time at which the import was marked as processed. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

ready_at
null or string <date-time>

Time at which the import was marked as ready. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

invalid_rows_count
number

Invalid Rows Count

valid_rows_count
number

Valid Rows Count

rows_count
number

Rows Count

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

original_filename
string
type
string

Import Type

status
string

Import Status

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

Content type
application/json
{
  • "type": "customers",
  • "filename": "a.csv",
  • "original_filename": "a.csv",
  • "auto": true
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a import

Retrieve a import.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: IMKd7zlGJAna

Import ID.

Responses

Response Schema: application/json
object (Import)

This object represents an import of your account.

id
string

Unique identifier for the Import.

batch_job
object
cancelled_at
null or string <date-time>

Time at which the import was marked as cancelled. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

invalid_at
null or string <date-time>

Time at which the import was marked as invalid. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

processed_at
null or string <date-time>

Time at which the import was marked as processed. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

ready_at
null or string <date-time>

Time at which the import was marked as ready. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

invalid_rows_count
number

Invalid Rows Count

valid_rows_count
number

Valid Rows Count

rows_count
number

Rows Count

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

original_filename
string
type
string

Import Type

status
string

Import Status

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

curl --request GET \
  --url https://api.debi.pro/v1/imports/IMKd7zlGJAna \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

List Import Rows

List Import Rows.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: IMKd7zlGJAna

Import ID.

query Parameters
filter
string

Validation. Example: valid. Allows values: valid, invalid.

object (range_query_specs)

A filter on the list, based on the object created_at field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.

ending_before
string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

starting_after
string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response Schema: application/json
required
Array of objects (Import Row)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/imports/IMKd7zlGJAna/rows?filter=SOME_STRING_VALUE&created_at=SOME_OBJECT_VALUE&ending_before=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&starting_after=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {}
}

Mandates

A Mandate is a record of the permission a customer has given you to debit their payment method.

id
string

Unique identifier for the Mandate.

status
string
Enum: "active" "revoked"

Status.

uuid
string

UUID identifier for the object. [Legacy]

object
string
Value: "mandate"
livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

object (Customer)

This object represents a customer of your organization.

object (Payment Method)

This object represents a payment method of your account.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

deleted_at
null or string <date-time>

Time at which the object was deleted. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

{
  • "created_at": "2022-02-01T19:06:37-03:00",
  • "customer": {
    },
  • "deleted_at": null,
  • "id": "MA9aQOWen2kZe6qypB",
  • "uuid": "3990a740-83ab-11ec-8651-cde6203c968e",
  • "livemode": true,
  • "metadata": {
    },
  • "object": "mandate",
  • "payment_method": {
    },
  • "status": "active",
  • "updated_at": "2022-02-01T19:06:37-03:00"
}

List all mandates

By default newest mandates will be first on the list.

Authorizations:
SecretKeyAuthentication
query Parameters
all
boolean

Include archived mandates.

customer_id
string
Example: customer_id=CS9PL8eeo8aB
object (range_query_specs)

A filter on the list, based on the object created_at field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.

ending_before
string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

starting_after
string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response Schema: application/json
required
Array of objects (Mandate)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/mandates?all=SOME_BOOLEAN_VALUE&customer_id=SOME_STRING_VALUE&created_at=SOME_OBJECT_VALUE&ending_before=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&starting_after=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {}
}

Create a mandate

Create a mandate.

Authorizations:
SecretKeyAuthentication
Request Body schema: application/json
optional
customer_id
string
payment_method_id

Responses

Request samples

Content type
application/json
{
  • "customer_id": "CS3oDRqz9wzB",
  • "payment_method_id": "PMBja4YZ2GDR"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a mandate

Retrieve a mandate.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: MA9aQOWen2kZe6qypB

Responses

Response Schema: application/json
object (Mandate)

This object represents a mandate of your organization.

id
string

Unique identifier for the Mandate.

status
string
Enum: "active" "revoked"

Status.

uuid
string

UUID identifier for the object. [Legacy]

object
string
Value: "mandate"
livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

object (Customer)

This object represents a customer of your organization.

object (Payment Method)

This object represents a payment method of your account.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

deleted_at
null or string <date-time>

Time at which the object was deleted. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

curl --request GET \
  --url https://api.debi.pro/v1/mandates/MA9aQOWen2kZe6qypB \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Revoke a mandate

This action will revoke the mandate and also cancel all the cancellable subscriptions attached to the same customer and payment method.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: MA9aQOWen2kZe6qypB

Responses

Request samples

curl --request POST \
  --url https://api.debi.pro/v1/mandates/MA9aQOWen2kZe6qypB/actions/revoke \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Restore mandate

This action will restore the revoked mandate.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: MA9aQOWen2kZe6qypB

Responses

Request samples

curl --request POST \
  --url https://api.debi.pro/v1/mandates/MA9aQOWen2kZe6qypB/actions/restore \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Search mandates

Search mandates.

Authorizations:
SecretKeyAuthentication
query Parameters
q
required
string
Example: q=john doe

The search query string. See search query language and the list of supported query fields for charges.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

page
required
string
Example: page=john doe

A cursor for pagination across multiple pages of results. Don’t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.

Responses

Response Schema: application/json
required
Array of objects (Mandate)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/mandates/search?q=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&page=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Payment Methods

PaymentMethod objects represent your customer's payment instruments. You can use them with to create Payments or Subscriptions to a Customer.

id
string

Unique identifier for the object.

object
string
Value: "payment_method"
type
string
Enum: "card" "cbu"

Type of paymet method. One of: cbu, card.

object (Credit Card)

This object represents a credit card of your account.

object (CBU)

This object represents a CBU bak account of your account.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

{
  • "card": {
    },
  • "created_at": "2022-02-01T23:13:04-03:00",
  • "id": "PMBja4YZ2GDR",
  • "livemode": true,
  • "metadata": null,
  • "object": "payment_method",
  • "type": "card",
  • "updated_at": "2022-02-01T23:13:04-03:00"
}

List all payment methods

Returns a list of payment methods.

Authorizations:
SecretKeyAuthentication
query Parameters
page
number
Example: page=1

Cursor value to paginate response.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

Responses

Response Schema: application/json
required
Array of objects (Payment Method)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/payment_methods?page=SOME_NUMBER_VALUE&limit=SOME_INTEGER_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "links": {},
  • "meta": {}
}

Create a payment method

Create a payment method

Authorizations:
PublishableKeyAuthenticationSecretKeyAuthentication
Request Body schema: application/json
optional
type
string
Enum: "card" "cbu"

One of card or cbu.

object (Credit Card)

This object represents a credit card of your account.

object (CBU)

This object represents a CBU bak account of your account.

Responses

Response Schema: application/json
object (Payment Method)

This object represents a payment method of your account.

id
string

Unique identifier for the object.

object
string
Value: "payment_method"
type
string
Enum: "card" "cbu"

Type of paymet method. One of: cbu, card.

object (Credit Card)

This object represents a credit card of your account.

object (CBU)

This object represents a CBU bak account of your account.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

Content type
application/json
Example
{
  • "type": "card",
  • "card": {
    }
}

Response samples

Content type
application/json
Example
{
  • "data": {
    }
}

Retrieve a payment method

Retrieve a payment method.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: PMVA0W8y1aQO

Payment method ID.

Responses

Response Schema: application/json
object (Payment Method)

This object represents a payment method of your account.

id
string

Unique identifier for the object.

object
string
Value: "payment_method"
type
string
Enum: "card" "cbu"

Type of paymet method. One of: cbu, card.

object (Credit Card)

This object represents a credit card of your account.

object (CBU)

This object represents a CBU bak account of your account.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

curl --request GET \
  --url https://api.debi.pro/v1/payment_methods/PMVA0W8y1aQO \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Search payment methods

Search payment methods.

Authorizations:
SecretKeyAuthentication
query Parameters
q
required
string
Example: q=john doe

The search query string. See search query language and the list of supported query fields for charges.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

page
required
string
Example: page=john doe

A cursor for pagination across multiple pages of results. Don’t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.

Responses

Response Schema: application/json
required
Array of objects (Payment Method)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/payment_methods/search?q=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&page=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Payments

A Payment is an object you create to charge a credit, debit card, or bank account. You can retrieve information about the payment and also refund them partially or totally.

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 by 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
chargeback The customer asked the bank to get them their money back
refunded The payment has been returned to the customer
partially_refunded A partial amount of the payment has been returned to the customer
id
string

Unique identifier for the Payment.

object
string
Value: "payment"
amount
number

Payment amount

amount_refunded
number

Payment amount refunded.

currency
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

description
string

Payment description

status
string
Enum: "pending_submission" "cancelled" "submitted" "failed" "will_retry" "approved" "rejected" "chargeback" "refunded" "partially_refunded"

Payment Status

response_message
string

Financial institution detailed response

paid
boolean

The payment has been succesfully collected.

retryable
boolean

The payment can be retried.

refundable
boolean

The payment can be refunded.

amount_refundable
number

The amount of payment that can be refunded.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

charge_date
string

A future date on which the payment should be collected. If not specified, the payment will be collected as soon as possible.

submissions_count
number

The number of time the payment has been sent to the financial institution.

can_auto_retry_until
null or string

The latest date the payment will be sent to the financial institution. Null means no limit

auto_retries_max_attempts
null or number

The maximum number of times the payment could be automatically retried.

effective_charged_date
null or string

The date when the payment will be collected.

estimated_accreditation_date
null or string

The estimated date when the financial institution will send the amount collect to your account.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_status
null or string

The latest date the payment status was changed.

object (Customer)

This object represents a customer of your organization.

subscription
null or string

The Subscription associated with the payment if existent.

subscription_payment_number
null or string

The number of payment of the associated Subscription, if existent.

gateway
string

The Gateway associated with the payment.

object (Payment Method)

This object represents a payment method of your account.

gateway_identifier
null or string

The custom number you send to the gateway network. In most cases this value is null.

binary_mode
boolean

Forces instantaneous payment processing, providing an immediate status of either approved or rejected within the request response. This setting eliminates automatic retries for failed payments, ensuring a swift and conclusive outcome.

refunds
Array of arrays

Refunds associated with this payment.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

{
  • "id": "PY9J8YYdylz6",
  • "object": "payment",
  • "amount": 2300,
  • "amount_refunded": 0,
  • "currency": "ARS",
  • "description": "Ajuste por deuda pasada",
  • "status": "approved",
  • "response_message": "Transacción aceptada",
  • "paid": true,
  • "retryable": false,
  • "refundable": true,
  • "amount_refundable": 2300,
  • "livemode": true,
  • "created_at": "2022-08-03T12:24:33-03:00",
  • "charge_date": "2022-08-03",
  • "submissions_count": 1,
  • "can_auto_retry_until": null,
  • "auto_retries_max_attempts": null,
  • "effective_charged_date": "2022-08-05",
  • "estimated_accreditation_date": "2022-08-19",
  • "updated_at": "2022-08-03T12:24:33-03:00",
  • "updated_status": "2022-08-05",
  • "customer": {
    },
  • "subscription": null,
  • "subscription_payment_number": null,
  • "gateway": "GW1L49J7ARW3",
  • "payment_method": {
    },
  • "gateway_identifier": null,
  • "metadata": null,
  • "refunds": [ ]
}

List payments

Newest payments will be first on the list.

Authorizations:
SecretKeyAuthentication
query Parameters
customer_id
string
Example: customer_id=CS9PL8eeo8aB

Show only payment methods from a given customer.

subscription_id
string
Example: subscription_id=SBmX1MrZ77Mwq3

Show only payment methods from a given subscription.

object (range_query_specs)

A filter on the list, based on the object created_at field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.

ending_before
string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

starting_after
string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response Schema: application/json
required
Array of objects (Payment)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/payments?customer_id=SOME_STRING_VALUE&subscription_id=SOME_STRING_VALUE&created_at=SOME_OBJECT_VALUE&ending_before=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&starting_after=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {}
}

Create a payment

Create a payment.

Authorizations:
SecretKeyAuthentication
Request Body schema: application/json
optional
amount
required
number

The amount of the payment.

description
required
string

The description of the payment.

customer_id
required
string
payment_method_id
required
string

The Payment Method ID for this payment.

charge_date
string <date>

A future date on which the payment should be collected. If not specified, the payment will be collected as soon as possible.

can_auto_retry_until
string <date>

The maximum date the payment could be retried automatically.

auto_retries_max_attempts
integer

The maximum amount of times the payment could be retried automatically.

gateway_identifier
string

Gateway identifier for your payment.

binary_mode
boolean

Forces instantaneous payment processing, providing an immediate status of either approved or rejected within the request response. This setting eliminates automatic retries for failed payments, ensuring a swift and conclusive outcome.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Responses

Response Schema: application/json
object (Payment)

This object represents a payments of your organization.

id
string

Unique identifier for the Payment.

object
string
Value: "payment"
amount
number

Payment amount

amount_refunded
number

Payment amount refunded.

currency
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

description
string

Payment description

status
string
Enum: "pending_submission" "cancelled" "submitted" "failed" "will_retry" "approved" "rejected" "chargeback" "refunded" "partially_refunded"

Payment Status

response_message
string

Financial institution detailed response

paid
boolean

The payment has been succesfully collected.

retryable
boolean

The payment can be retried.

refundable
boolean

The payment can be refunded.

amount_refundable
number

The amount of payment that can be refunded.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

charge_date
string

A future date on which the payment should be collected. If not specified, the payment will be collected as soon as possible.

submissions_count
number

The number of time the payment has been sent to the financial institution.

can_auto_retry_until
null or string

The latest date the payment will be sent to the financial institution. Null means no limit

auto_retries_max_attempts
null or number

The maximum number of times the payment could be automatically retried.

effective_charged_date
null or string

The date when the payment will be collected.

estimated_accreditation_date
null or string

The estimated date when the financial institution will send the amount collect to your account.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_status
null or string

The latest date the payment status was changed.

object (Customer)

This object represents a customer of your organization.

subscription
null or string

The Subscription associated with the payment if existent.

subscription_payment_number
null or string

The number of payment of the associated Subscription, if existent.

gateway
string

The Gateway associated with the payment.

object (Payment Method)

This object represents a payment method of your account.

gateway_identifier
null or string

The custom number you send to the gateway network. In most cases this value is null.

binary_mode
boolean

Forces instantaneous payment processing, providing an immediate status of either approved or rejected within the request response. This setting eliminates automatic retries for failed payments, ensuring a swift and conclusive outcome.

refunds
Array of arrays

Refunds associated with this payment.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

Content type
application/json
{
  • "amount": 100,
  • "description": "Unique payment",
  • "gateway_identifier": "001234",
  • "customer_id": "CSr7Dg3LkDP2",
  • "payment_method_id": "PMBja4YZ2GDR"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a payment

Retrieve a payment.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: PYdOz9bgVReV

Responses

Response Schema: application/json
object (Payment)

This object represents a payments of your organization.

id
string

Unique identifier for the Payment.

object
string
Value: "payment"
amount
number

Payment amount

amount_refunded
number

Payment amount refunded.

currency
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

description
string

Payment description

status
string
Enum: "pending_submission" "cancelled" "submitted" "failed" "will_retry" "approved" "rejected" "chargeback" "refunded" "partially_refunded"

Payment Status

response_message
string

Financial institution detailed response

paid
boolean

The payment has been succesfully collected.

retryable
boolean

The payment can be retried.

refundable
boolean

The payment can be refunded.

amount_refundable
number

The amount of payment that can be refunded.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

charge_date
string

A future date on which the payment should be collected. If not specified, the payment will be collected as soon as possible.

submissions_count
number

The number of time the payment has been sent to the financial institution.

can_auto_retry_until
null or string

The latest date the payment will be sent to the financial institution. Null means no limit

auto_retries_max_attempts
null or number

The maximum number of times the payment could be automatically retried.

effective_charged_date
null or string

The date when the payment will be collected.

estimated_accreditation_date
null or string

The estimated date when the financial institution will send the amount collect to your account.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_status
null or string

The latest date the payment status was changed.

object (Customer)

This object represents a customer of your organization.

subscription
null or string

The Subscription associated with the payment if existent.

subscription_payment_number
null or string

The number of payment of the associated Subscription, if existent.

gateway
string

The Gateway associated with the payment.

object (Payment Method)

This object represents a payment method of your account.

gateway_identifier
null or string

The custom number you send to the gateway network. In most cases this value is null.

binary_mode
boolean

Forces instantaneous payment processing, providing an immediate status of either approved or rejected within the request response. This setting eliminates automatic retries for failed payments, ensuring a swift and conclusive outcome.

refunds
Array of arrays

Refunds associated with this payment.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

curl --request GET \
  --url https://api.debi.pro/v1/payments/PYdOz9bgVReV \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update a payment

Update a payment.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: PYdOz9bgVReV
Request Body schema: application/json
required
amount
number

The new amount of the payment.

auto_retries_max_attempts
integer

The maximum amount of times the payment could be retried automatically.

can_auto_retry_until
string <date>

The maximum date the payment could be retried automatically.

charge_date
string <date>

A future date on which the payment should be collected.

description
string

The new description of the payment.

payment_method_id
string

The Payment Method ID for this payment.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Responses

Response Schema: application/json
object (Payment)

This object represents a payments of your organization.

id
string

Unique identifier for the Payment.

object
string
Value: "payment"
amount
number

Payment amount

amount_refunded
number

Payment amount refunded.

currency
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

description
string

Payment description

status
string
Enum: "pending_submission" "cancelled" "submitted" "failed" "will_retry" "approved" "rejected" "chargeback" "refunded" "partially_refunded"

Payment Status

response_message
string

Financial institution detailed response

paid
boolean

The payment has been succesfully collected.

retryable
boolean

The payment can be retried.

refundable
boolean

The payment can be refunded.

amount_refundable
number

The amount of payment that can be refunded.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

charge_date
string

A future date on which the payment should be collected. If not specified, the payment will be collected as soon as possible.

submissions_count
number

The number of time the payment has been sent to the financial institution.

can_auto_retry_until
null or string

The latest date the payment will be sent to the financial institution. Null means no limit

auto_retries_max_attempts
null or number

The maximum number of times the payment could be automatically retried.

effective_charged_date
null or string

The date when the payment will be collected.

estimated_accreditation_date
null or string

The estimated date when the financial institution will send the amount collect to your account.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_status
null or string

The latest date the payment status was changed.

object (Customer)

This object represents a customer of your organization.

subscription
null or string

The Subscription associated with the payment if existent.

subscription_payment_number
null or string

The number of payment of the associated Subscription, if existent.

gateway
string

The Gateway associated with the payment.

object (Payment Method)

This object represents a payment method of your account.

gateway_identifier
null or string

The custom number you send to the gateway network. In most cases this value is null.

binary_mode
boolean

Forces instantaneous payment processing, providing an immediate status of either approved or rejected within the request response. This setting eliminates automatic retries for failed payments, ensuring a swift and conclusive outcome.

refunds
Array of arrays

Refunds associated with this payment.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

Content type
application/json
{
  • "description": "New payment title"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Cancel payment

Cancel payment.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: PYdOz9bgVReV

Responses

Request samples

curl --request POST \
  --url https://api.debi.pro/v1/payments/PYdOz9bgVReV/actions/cancel \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "message": "Cancelled successfully"
}

Retry a payment

Retry a payment.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: PYdOz9bgVReV

Responses

Request samples

curl --request POST \
  --url https://api.debi.pro/v1/payments/PYdOz9bgVReV/actions/retry \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "message": "Retried successfully"
}

Stop auto retrying

Stop auto retrying, avoid the payment beying retrying after a rejection. This action can be requested at any time of the payment cycle, even when the payment is sent and beying processed by the finantial institution.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: PYdOz9bgVReV

Responses

Request samples

curl --request POST \
  --url https://api.debi.pro/v1/payments/PYdOz9bgVReV/actions/stop_auto_retrying \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "message": "Stopped autoretries successfully"
}

Search payments

Search payments.

Authorizations:
SecretKeyAuthentication
query Parameters
q
required
string
Example: q=john doe

The search query string. See search query language and the list of supported query fields for charges.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

page
required
string
Example: page=john doe

A cursor for pagination across multiple pages of results. Don’t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.

Responses

Response Schema: application/json
required
Array of objects (Payment)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/payments/search?q=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&page=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Refunds

Refund objects allow you to refund a payment that has previously been created but not yet totally refunded. Funds will be refunded to the credit, debit card, or bank account that was originally charged.

Status Meaning
pending_submission The refund has been issued, but still not submitted to the finnancial entity
submitted The refund is succesfully submitted and being processing by the finnancial entity
failed Submitted OK but rejected by the finnancial entity
approved Submitted OK and approved
id
string

Unique identifier for the Refund.

object
string
Value: "refund"
payment_id
string
amount
number

Refund amount.

currency
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

reason
string
Enum: "duplicate" "error" "requested_by_customer"

Refund Reason

status
string
Enum: "pending_submission" "submitted" "failed" "approved"

Refund Status

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

{
  • "id": "RFOBXM90YZp4AD",
  • "object": "refund",
  • "payment_id": "PYpzMDDy4mJ3",
  • "amount": 100,
  • "currency": "ARS",
  • "reason": "error",
  • "status": "approved",
  • "created_at": "2022-02-05T12:24:33-03:00",
  • "updated_at": "2022-02-05T12:24:33-03:00",
  • "metadata": null
}

List all refunds

By default newest refunds will be first on the list.

Authorizations:
SecretKeyAuthentication
query Parameters
object (range_query_specs)

A filter on the list, based on the object created_at field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.

ending_before
string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

starting_after
string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response Schema: application/json
required
Array of objects (Refund)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/refunds?created_at=SOME_OBJECT_VALUE&ending_before=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&starting_after=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{}

Create a refund

Create a refund.

Authorizations:
SecretKeyAuthentication
Request Body schema: application/json
payment_id
required
string
amount
number

Amount to be refunded. If is null it will refund the whole payment.

reason
required
string

Refund Reason. One of duplicate, error, or requested_by_customer.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Responses

Response Schema: application/json
object (Refund)

This object represents a refunds of your organization.

id
string

Unique identifier for the Refund.

object
string
Value: "refund"
payment_id
string
amount
number

Refund amount.

currency
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

reason
string
Enum: "duplicate" "error" "requested_by_customer"

Refund Reason

status
string
Enum: "pending_submission" "submitted" "failed" "approved"

Refund Status

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

Content type
application/json
{
  • "payment_id": "PYgaZlLaPMZO.",
  • "amount": 12.5,
  • "reason": "requested_by_customer",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a refund

Retrieve a refund.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: RFgaZlLaPMZO

Responses

Response Schema: application/json
object (Refund)

This object represents a refunds of your organization.

id
string

Unique identifier for the Refund.

object
string
Value: "refund"
payment_id
string
amount
number

Refund amount.

currency
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

reason
string
Enum: "duplicate" "error" "requested_by_customer"

Refund Reason

status
string
Enum: "pending_submission" "submitted" "failed" "approved"

Refund Status

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

curl --request GET \
  --url https://api.debi.pro/v1/refunds/RFgaZlLaPMZO \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Sessions

Sessions enable you to use Debi's hosted payment pages to set up mandates, subscriptions or payments with your customers.

First you create a Session for your customer, and redirect them to the returned redirect url. Your customer supplies their name, email, address, and bank account or card details, and submits the form. This securely stores their details, and redirects them back to your back_url with session_id=THE_SESSION_ID in the querystring.

You complete the Session, which creates a customer, payment method, and either payment, mandate or subscription, and returns the ID of the session. With this data you may wish to create a subscription or payment at this point.

Once you have completed the Session via the API, you should display a confirmation page to your customer, confirming that data has been set up. You can build your own page, or redirect to the one we provide in the confirmation_url attribute of the Session.

Session expire after completed. You cannot complete an expired or already completed Session.

id
string

Unique identifier for the Session.

uuid
string

UUID identifier for the object. [Legacy]

object
string
Value: "session"
description
string

Session description

amount
number

Amount to be collected.

kind
string
Enum: "mandate" "payment" "subscription"
customer_id
string

Unique identifier for the Customer.

customer_name
null or string

The customer's full name or business name.

customer_email
null or string

The customer's email address.

customer_gateway_identifier
null or string

The customer's reference for bank account statements.

editable_amount
boolean

Allow the customer to set the amount, useful for donations.

installments
integer

Only for payments, quantity of payments on which the amount will be splitted.

max_installments
integer

Only for payments, allow the customer to choose how many installments can split the payment.

interval_unit
string

Only for subscriptions. The unit of time between customer charge dates. One of weekly, monthly or yearly. Example monthly.

interval
number

Only for subscriptions. Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

count
number
editable_count
boolean
name_text
string
created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

completed_at
string <date-time>

Time at which the sessions was completed. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

deleted_at
null or string <date-time>

Time at which the object was deleted. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

binary_mode
boolean

Forces instantaneous payment processing, providing an immediate status of either approved or rejected within the request response. This setting eliminates automatic retries for failed payments, ensuring a swift and conclusive outcome.

payment_gateway_identifier
null or string

The custom number you send to the gateway network. In most cases this value is null.

public_uri
string

The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout.

success_url
string

The uri on which your customer will be redirected after completing the checkout.

link_id
string

Link ID.

{
  • "amount": "100.00",
  • "brands": [ ],
  • "completed_at": null,
  • "count": null,
  • "created_at": "2022-02-11T23:17:54.00-03:00",
  • "customer_email": null,
  • "customer_id": null,
  • "customer_name": null,
  • "day_of_month": null,
  • "day_of_week": null,
  • "deleted_at": null,
  • "description": "mucho",
  • "editable_amount": false,
  • "editable_count": false,
  • "extra_fields": [ ],
  • "extra_fields_customer": [ ],
  • "id": "SSnO8b9w7B51VE0B5m",
  • "uuid": "d6fe7bf0-8b90-11ec-9bb7-ad20fd301d81",
  • "installments": 1,
  • "interval": 1,
  • "interval_unit": "monthly",
  • "kind": "payment",
  • "link_id": "b7fba990-83cc-11ec-8c7b-5b2fd150abb2",
  • "livemode": true,
  • "max_installments": null,
  • "name_text": null,
  • "object": "session",
  • "updated_at": "2022-02-11T23:17:55.00-03:00",
  • "user": {}
}

Create a sesssion

Create a session

Authorizations:
SecretKeyAuthentication
Request Body schema: application/json
optional
kind
string
Enum: "payment" "subscription" "mandate"

One of payment, subscription or mandate.

success_url
string

The uri on which your customer will be redirected after completing the checkout.

amount
string

The amount of the payment or subscription.

description
string

The title of the payment or subscription.

customer_id
string
customer_name
string

Name of your customer. You can fill it or ask the customer to fill this field in the checkout process.

customer_email
string

Email of your customer. You can fill it or ask the customer to fill this field in the checkout process.

customer_gateway_identifier
null or string

The customer's reference for bank account statements.

editable_amount
boolean

Allow the customer to set the amount, useful for donations.

installments
integer

Only for payments, quantity of payments on which the amount will be splitted.

max_installments
integer

Only for payments, allow the customer to choose how many installments can split the payment.

interval_unit
string
Enum: "weekly" "monthly" "yearly"

Only for subscriptions, the unit of time between customer charge dates. One of weekly, monthly or yearly.

interval
integer

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

Only for subscriptions, the day of month, from 1 to 28. Use only if you need the subscription to start in a specyfic date. In most cases this should be null, therefore Debi will use the date of the moment when the user completes the checkout.

day_of_week
integer

Only for subscriptions, the day of week number, from 0 (Sunday) to 6 (Saturday). Use only if you need the subscription to start in a specyfic date. In most cases this should be null, therefore Debi will use the date of the moment when the user completes the checkout.

payment_gateway_identifier
null or string

The custom number you send to the gateway network. In most cases this value is null.

binary_mode
boolean

Forces instantaneous payment processing, providing an immediate status of either approved or rejected within the request response. This setting eliminates automatic retries for failed payments, ensuring a swift and conclusive outcome.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

extra_fields
object or null

A collection of fields designed to be stored as the metadata of the object that the Session is generating whether it's a Payment, Subscription, or Mandate. This functionality enables you to request extra information from the user during the checkout process, providing a means to store supplementary details about the object in a well-organized format.

extra_fields_customer
object or null

A collection of fields designed to be stored as the metadata of the Customer that the Session is generating. This functionality enables you to request extra information from the user during the checkout process, providing a means to store supplementary details about the object in a well-organized format.

count
integer

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
number

Only for subscriptions, allow the customer to set the duration of the subscriptions, useful for donations.

Responses

Response Schema: application/json
object (Session)

This object represents a Session of your organization.

id
string

Unique identifier for the Session.

uuid
string

UUID identifier for the object. [Legacy]

object
string
Value: "session"
description
string

Session description

amount
number

Amount to be collected.

kind
string
Enum: "mandate" "payment" "subscription"
customer_id
string

Unique identifier for the Customer.

customer_name
null or string

The customer's full name or business name.

customer_email
null or string

The customer's email address.

customer_gateway_identifier
null or string

The customer's reference for bank account statements.

editable_amount
boolean

Allow the customer to set the amount, useful for donations.

installments
integer

Only for payments, quantity of payments on which the amount will be splitted.

max_installments
integer

Only for payments, allow the customer to choose how many installments can split the payment.

interval_unit
string

Only for subscriptions. The unit of time between customer charge dates. One of weekly, monthly or yearly. Example monthly.

interval
number

Only for subscriptions. Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

count
number
editable_count
boolean
name_text
string
created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

completed_at
string <date-time>

Time at which the sessions was completed. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

deleted_at
null or string <date-time>

Time at which the object was deleted. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

binary_mode
boolean

Forces instantaneous payment processing, providing an immediate status of either approved or rejected within the request response. This setting eliminates automatic retries for failed payments, ensuring a swift and conclusive outcome.

payment_gateway_identifier
null or string

The custom number you send to the gateway network. In most cases this value is null.

public_uri
string

The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout.

success_url
string

The uri on which your customer will be redirected after completing the checkout.

link_id
string

Link ID.

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a session

Retrieve a session.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: SSnO8b9w7B51VE0B5m

Responses

Response Schema: application/json
object (Session)

This object represents a Session of your organization.

id
string

Unique identifier for the Session.

uuid
string

UUID identifier for the object. [Legacy]

object
string
Value: "session"
description
string

Session description

amount
number

Amount to be collected.

kind
string
Enum: "mandate" "payment" "subscription"
customer_id
string

Unique identifier for the Customer.

customer_name
null or string

The customer's full name or business name.

customer_email
null or string

The customer's email address.

customer_gateway_identifier
null or string

The customer's reference for bank account statements.

editable_amount
boolean

Allow the customer to set the amount, useful for donations.

installments
integer

Only for payments, quantity of payments on which the amount will be splitted.

max_installments
integer

Only for payments, allow the customer to choose how many installments can split the payment.

interval_unit
string

Only for subscriptions. The unit of time between customer charge dates. One of weekly, monthly or yearly. Example monthly.

interval
number

Only for subscriptions. Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

count
number
editable_count
boolean
name_text
string
created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

completed_at
string <date-time>

Time at which the sessions was completed. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

deleted_at
null or string <date-time>

Time at which the object was deleted. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

binary_mode
boolean

Forces instantaneous payment processing, providing an immediate status of either approved or rejected within the request response. This setting eliminates automatic retries for failed payments, ensuring a swift and conclusive outcome.

payment_gateway_identifier
null or string

The custom number you send to the gateway network. In most cases this value is null.

public_uri
string

The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout.

success_url
string

The uri on which your customer will be redirected after completing the checkout.

link_id
string

Link ID.

Request samples

curl --request GET \
  --url https://api.debi.pro/v1/sessions/SSnO8b9w7B51VE0B5m \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Subscriptions

Subscriptions allow you to charge a customer on a recurring basis according to a schedule.

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 created succesfully.
id
required
string

Unique identifier for the Subscription.

object
required
string
Value: "subscription"
amount
required
number

Subscription amount

description
required
string

Subscription description

currency
required
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

status
required
string
Enum: "active" "paused" "cancelled" "finished"

Subscription Status

count
required
null or number

The total number of payments that should be taken by this subscription.

start_date
required
string

A future date on which the first payment of the subscription should be collected.

interval_unit
required
string
Enum: "weekly" "monthly" "yearly"

The unit of time between customer charge dates.

interval
required
number

Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
required
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
required
null or number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
required
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

auto_retries_max_attempts
required
null or number

The maximum number of times the payments from this subscription could be automatically retried.

first_date
required
string

The date on which the first payment should be charged. When left blank and month or day_of_month are provided, this will be set to the date of the first payment. If created without month or day_of_month this will be set as soon as possible.

upcoming_dates
required
Array of strings

Up to 5 upcoming payments charge dates.

required
object (Customer)

This object represents a customer of your organization.

required
object (Payment Method)

This object represents a payment method of your account.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

{
  • "id": "SBmQ6j9NWxblNv",
  • "object": "subscription",
  • "amount": 5200,
  • "description": "Cuota mensual",
  • "currency": "ARS",
  • "status": "active",
  • "count": null,
  • "start_date": "2021-07-01",
  • "interval_unit": "monthly",
  • "interval": 1,
  • "day_of_month": 1,
  • "day_of_week": 1,
  • "livemode": true,
  • "created_at": "2021-07-01T12:24:32-03:00",
  • "updated_at": "2021-07-01T12:24:32-03:00",
  • "first_date": "2022-09-01",
  • "upcoming_dates": [
    ],
  • "customer": {
    },
  • "payment_method": {
    },
  • "metadata": null
}

List all subscriptions

By default newest subscriptions will be first on the list.

Authorizations:
SecretKeyAuthentication
query Parameters
object (range_query_specs)

A filter on the list, based on the object created_at field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.

ending_before
string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

starting_after
string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response Schema: application/json
required
Array of objects (Subscription)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/subscriptions?created_at=SOME_OBJECT_VALUE&ending_before=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&starting_after=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {}
}

Create a subscription

Create a subscription

Authorizations:
SecretKeyAuthentication
Request Body schema: application/json
optional
amount
required
number

The amount of each payment of the subscription.

description
required
string <= 255 characters

The description of each payment of the subscription.

count
number

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
required
string
payment_method_id
string

Payment Method ID. This field is required if payment_method_number is not given.

start_date
string

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
required
string

The unit of time between customer charge dates. One of weekly, monthly or yearly. Example monthly.

interval
number

Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

auto_retries_max_attempts
null or number

The maximum number of times the payments from this subscription could be automatically retried.

first_payment_in_binary_mode
boolean

Forces instantaneous payment processing for the first payment of the subscription. This provides an immediate status of either approved or rejected within the request response. This setting eliminates automatic retries for failed payments, ensuring a swift and conclusive outcome.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Responses

Response Schema: application/json
object (Subscription)

This object represents a subscription of your organization.

id
required
string

Unique identifier for the Subscription.

object
required
string
Value: "subscription"
amount
required
number

Subscription amount

description
required
string

Subscription description

currency
required
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

status
required
string
Enum: "active" "paused" "cancelled" "finished"

Subscription Status

count
required
null or number

The total number of payments that should be taken by this subscription.

start_date
required
string

A future date on which the first payment of the subscription should be collected.

interval_unit
required
string
Enum: "weekly" "monthly" "yearly"

The unit of time between customer charge dates.

interval
required
number

Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
required
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
required
null or number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
required
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

auto_retries_max_attempts
required
null or number

The maximum number of times the payments from this subscription could be automatically retried.

first_date
required
string

The date on which the first payment should be charged. When left blank and month or day_of_month are provided, this will be set to the date of the first payment. If created without month or day_of_month this will be set as soon as possible.

upcoming_dates
required
Array of strings

Up to 5 upcoming payments charge dates.

required
object (Customer)

This object represents a customer of your organization.

required
object (Payment Method)

This object represents a payment method of your account.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

Content type
application/json
{
  • "amount": 100,
  • "description": "Some subscription description",
  • "customer_id": "CS9PL8eeo8aB",
  • "payment_method_id": "PMBja4YZ2GDR",
  • "interval_unit": "monthly",
  • "day_of_month": 1,
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a subscription

Retrieve a subscription.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: SBmX1MrZ77Mwq3

Responses

Response Schema: application/json
object (Subscription)

This object represents a subscription of your organization.

id
required
string

Unique identifier for the Subscription.

object
required
string
Value: "subscription"
amount
required
number

Subscription amount

description
required
string

Subscription description

currency
required
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

status
required
string
Enum: "active" "paused" "cancelled" "finished"

Subscription Status

count
required
null or number

The total number of payments that should be taken by this subscription.

start_date
required
string

A future date on which the first payment of the subscription should be collected.

interval_unit
required
string
Enum: "weekly" "monthly" "yearly"

The unit of time between customer charge dates.

interval
required
number

Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
required
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
required
null or number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
required
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

auto_retries_max_attempts
required
null or number

The maximum number of times the payments from this subscription could be automatically retried.

first_date
required
string

The date on which the first payment should be charged. When left blank and month or day_of_month are provided, this will be set to the date of the first payment. If created without month or day_of_month this will be set as soon as possible.

upcoming_dates
required
Array of strings

Up to 5 upcoming payments charge dates.

required
object (Customer)

This object represents a customer of your organization.

required
object (Payment Method)

This object represents a payment method of your account.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

curl --request GET \
  --url https://api.debi.pro/v1/subscriptions/SBmX1MrZ77Mwq3 \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update a subscription

Update a subscription.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: SBmX1MrZ77Mwq3

Subscription ID.

Request Body schema: application/json
optional
amount
number

The amount of each payment of the subscription.

description
string <= 255 characters

The title of each payment of the subscription.

count
number

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
payment_method_id
string

The Payment Method ID for each payment of the subscription. This field is required if payment_method_number is not given.

start_date
string

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

The unit of time between customer charge dates. One of weekly, monthly or yearly. Example monthly

interval
number

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
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

auto_retries_max_attempts
null or number

The maximum number of times the payments from this subscription could be automatically retried.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Responses

Response Schema: application/json
object (Subscription)

This object represents a subscription of your organization.

id
required
string

Unique identifier for the Subscription.

object
required
string
Value: "subscription"
amount
required
number

Subscription amount

description
required
string

Subscription description

currency
required
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

status
required
string
Enum: "active" "paused" "cancelled" "finished"

Subscription Status

count
required
null or number

The total number of payments that should be taken by this subscription.

start_date
required
string

A future date on which the first payment of the subscription should be collected.

interval_unit
required
string
Enum: "weekly" "monthly" "yearly"

The unit of time between customer charge dates.

interval
required
number

Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
required
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
required
null or number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
required
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

auto_retries_max_attempts
required
null or number

The maximum number of times the payments from this subscription could be automatically retried.

first_date
required
string

The date on which the first payment should be charged. When left blank and month or day_of_month are provided, this will be set to the date of the first payment. If created without month or day_of_month this will be set as soon as possible.

upcoming_dates
required
Array of strings

Up to 5 upcoming payments charge dates.

required
object (Customer)

This object represents a customer of your organization.

required
object (Payment Method)

This object represents a payment method of your account.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

Content type
application/json
{
  • "amount": 100,
  • "description": "Some subscription description",
  • "customer_id": "CS9PL8eeo8aB",
  • "payment_method_id": "PMBja4YZ2GDR",
  • "interval_unit": "monthly",
  • "day_of_month": 1,
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Pause a subscription

Pause a subscription.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: SBmX1MrZ77Mwq3

Responses

Response Schema: application/json
object (Subscription)

This object represents a subscription of your organization.

id
required
string

Unique identifier for the Subscription.

object
required
string
Value: "subscription"
amount
required
number

Subscription amount

description
required
string

Subscription description

currency
required
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

status
required
string
Enum: "active" "paused" "cancelled" "finished"

Subscription Status

count
required
null or number

The total number of payments that should be taken by this subscription.

start_date
required
string

A future date on which the first payment of the subscription should be collected.

interval_unit
required
string
Enum: "weekly" "monthly" "yearly"

The unit of time between customer charge dates.

interval
required
number

Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
required
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
required
null or number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
required
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

auto_retries_max_attempts
required
null or number

The maximum number of times the payments from this subscription could be automatically retried.

first_date
required
string

The date on which the first payment should be charged. When left blank and month or day_of_month are provided, this will be set to the date of the first payment. If created without month or day_of_month this will be set as soon as possible.

upcoming_dates
required
Array of strings

Up to 5 upcoming payments charge dates.

required
object (Customer)

This object represents a customer of your organization.

required
object (Payment Method)

This object represents a payment method of your account.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

curl --request POST \
  --url https://api.debi.pro/v1/subscriptions/SBmX1MrZ77Mwq3/actions/pause \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Resume a subscription

Resume a subscription.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: SBmX1MrZ77Mwq3

Subscription ID.

Responses

Response Schema: application/json
object (Subscription)

This object represents a subscription of your organization.

id
required
string

Unique identifier for the Subscription.

object
required
string
Value: "subscription"
amount
required
number

Subscription amount

description
required
string

Subscription description

currency
required
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

status
required
string
Enum: "active" "paused" "cancelled" "finished"

Subscription Status

count
required
null or number

The total number of payments that should be taken by this subscription.

start_date
required
string

A future date on which the first payment of the subscription should be collected.

interval_unit
required
string
Enum: "weekly" "monthly" "yearly"

The unit of time between customer charge dates.

interval
required
number

Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
required
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
required
null or number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
required
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

auto_retries_max_attempts
required
null or number

The maximum number of times the payments from this subscription could be automatically retried.

first_date
required
string

The date on which the first payment should be charged. When left blank and month or day_of_month are provided, this will be set to the date of the first payment. If created without month or day_of_month this will be set as soon as possible.

upcoming_dates
required
Array of strings

Up to 5 upcoming payments charge dates.

required
object (Customer)

This object represents a customer of your organization.

required
object (Payment Method)

This object represents a payment method of your account.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

curl --request POST \
  --url https://api.debi.pro/v1/subscriptions/SBmX1MrZ77Mwq3/actions/resume \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Cancel a subcription

This action cancels and archive the subscription. Also cancel the payments related to it.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: SBmX1MrZ77Mwq3

Responses

Response Schema: application/json
object (Subscription)

This object represents a subscription of your organization.

id
required
string

Unique identifier for the Subscription.

object
required
string
Value: "subscription"
amount
required
number

Subscription amount

description
required
string

Subscription description

currency
required
string
Enum: "ARS" "BRL" "CLP" "COP" "MXN" "USB" "USD"

Currency for the transacion using ISO_4217 codes. Defaults to account's default.

status
required
string
Enum: "active" "paused" "cancelled" "finished"

Subscription Status

count
required
null or number

The total number of payments that should be taken by this subscription.

start_date
required
string

A future date on which the first payment of the subscription should be collected.

interval_unit
required
string
Enum: "weekly" "monthly" "yearly"

The unit of time between customer charge dates.

interval
required
number

Number of interval_units between customer charge dates. Must be greater than to 1. If interval_units is weekly and interval is 2, then the customer will be charged every two weeks. Defaults to 1.

day_of_month
required
number

Day of month, from 1 to 28. This field is required if interval_unit is set to monthly. Defaults to 1.

day_of_week
required
null or number

Day of week number, from 0 (Sunday) to 6 (Saturday). This field is required if interval_unit is set to weekly.

livemode
required
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
required
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
required
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

auto_retries_max_attempts
required
null or number

The maximum number of times the payments from this subscription could be automatically retried.

first_date
required
string

The date on which the first payment should be charged. When left blank and month or day_of_month are provided, this will be set to the date of the first payment. If created without month or day_of_month this will be set as soon as possible.

upcoming_dates
required
Array of strings

Up to 5 upcoming payments charge dates.

required
object (Customer)

This object represents a customer of your organization.

required
object (Payment Method)

This object represents a payment method of your account.

metadata
required
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

Request samples

curl --request POST \
  --url https://api.debi.pro/v1/subscriptions/SBmX1MrZ77Mwq3/actions/cancel \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Search subscriptions

Search subscriptions.

Authorizations:
SecretKeyAuthentication
query Parameters
q
required
string
Example: q=john doe

The search query string. See search query language and the list of supported query fields for charges.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

page
required
string
Example: page=john doe

A cursor for pagination across multiple pages of results. Don’t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.

Responses

Response Schema: application/json
required
Array of objects (Subscription)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/subscriptions/search?q=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&page=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Webhooks

Webhooks are endpoints you can configure to be notified about events that happen in your Debi account. Most users configure Webhooks from the dashboard, which provides a user interface for registering and testing your webhook endpoints.

id
string

Unique identifier for the object.

object
string
Value: "webhook"
url
string <= 5000 characters

The URL of the webhook endpoint.

enabled
boolean

Whether the webhook is enabled.

enabled_events
Array of strings

One of: checkout.session.async_payment_failed, checkout.session.async_payment_succeeded, checkout.session.completed, checkout.session.expired, customer.created, customer.disabled, customer.restored, customer.updated, gateway.created, gateway.disabled, gateway.enabled, gateway.updated, import.processed, mandate.created, mandate.restored, mandate.revoked, payment.cancelled, payment.created, payment.retrying, payment.updated, payment_method.automatically_updated, payment_method.created, payment_method.updated, refund.approved, refund.created, refund.failed, subscription.automatically_paused, subscription.cancelled, subscription.created, subscription.finished, subscription.paused, subscription.resumed, subscription.updated, user.updated_available_brands.

secret
string <= 5000 characters

The endpoint's secret, used to generate webhook signatures.

failed_lately_count
integer <int32>
success_lately_count
integer <int32>
livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

{
  • "created_at": "2022-02-11T23:19:22-03:00",
  • "enabled": true,
  • "enabled_events": [
    ],
  • "id": "WHq4VzyAzDgB",
  • "livemode": true,
  • "object": "webhook",
  • "secret": "DmUeH9E9yJ7ax9IYQVm9HpQ3VWvIx0",
  • "updated_at": "2022-02-11T23:19:22-03:00",
}

List all webhooks

Returns a list of your webhooks.

Authorizations:
SecretKeyAuthentication
query Parameters
object (range_query_specs)

A filter on the list, based on the object created_at field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.

ending_before
string

A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

limit
integer
Example: limit=20

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 25.

starting_after
string

A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response Schema: application/json
required
Array of objects (Webhook)
object (Response Meta)

Pagination links

object (Response Meta)

Pagination metadata

Request samples

curl --request GET \
  --url 'https://api.debi.pro/v1/webhooks?created_at=SOME_OBJECT_VALUE&ending_before=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&starting_after=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{}

Create a webhook

Create a webhook.

Authorizations:
SecretKeyAuthentication
Request Body schema: application/json
required
enabled_events
Array of strings
Items Enum: "*" "checkout.session.async_payment_failed" "checkout.session.async_payment_succeeded" "checkout.session.completed" "checkout.session.expired" "customer.created" "customer.disabled" "customer.restored" "customer.updated" "gateway.created" "gateway.disabled" "gateway.enabled" "gateway.updated" "import.processed" "mandate.created" "mandate.restored" "mandate.revoked" "payment.cancelled" "payment.created" "payment.retrying" "payment.updated" "payment_method.automatically_updated" "payment_method.created" "payment_method.updated" "refund.approved" "refund.created" "refund.failed" "subscription.automatically_paused" "subscription.cancelled" "subscription.created" "subscription.finished" "subscription.paused" "subscription.resumed" "subscription.updated" "user.updated_available_brands"

The list of events to enable for this endpoint. You may specify ['*'] to enable all events, except those that require explicit selection.

metadata
object or null

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. All keys can be unset by posting null value to metadata.

url
required
string

The URL of the webhook endpoint.

Responses

Response Schema: application/json
object (Webhook)

You can configure webhook endpoints via the API to be notified about events that happen in your Debi account or connected accounts.

Most users configure webhooks from the dashboard, which provides a user interface for registering and testing your webhook endpoints.

id
string

Unique identifier for the object.

object
string
Value: "webhook"
url
string <= 5000 characters

The URL of the webhook endpoint.

enabled
boolean

Whether the webhook is enabled.

enabled_events
Array of strings

One of: checkout.session.async_payment_failed, checkout.session.async_payment_succeeded, checkout.session.completed, checkout.session.expired, customer.created, customer.disabled, customer.restored, customer.updated, gateway.created, gateway.disabled, gateway.enabled, gateway.updated, import.processed, mandate.created, mandate.restored, mandate.revoked, payment.cancelled, payment.created, payment.retrying, payment.updated, payment_method.automatically_updated, payment_method.created, payment_method.updated, refund.approved, refund.created, refund.failed, subscription.automatically_paused, subscription.cancelled, subscription.created, subscription.finished, subscription.paused, subscription.resumed, subscription.updated, user.updated_available_brands.

secret
string <= 5000 characters

The endpoint's secret, used to generate webhook signatures.

failed_lately_count
integer <int32>
success_lately_count
integer <int32>
livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

Content type
application/json

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve a webhook

Retrieves a webhook.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: WHq4VzyAzDgB

Webhook ID.

Responses

Response Schema: application/json
object (Webhook)

You can configure webhook endpoints via the API to be notified about events that happen in your Debi account or connected accounts.

Most users configure webhooks from the dashboard, which provides a user interface for registering and testing your webhook endpoints.

id
string

Unique identifier for the object.

object
string
Value: "webhook"
url
string <= 5000 characters

The URL of the webhook endpoint.

enabled
boolean

Whether the webhook is enabled.

enabled_events
Array of strings

One of: checkout.session.async_payment_failed, checkout.session.async_payment_succeeded, checkout.session.completed, checkout.session.expired, customer.created, customer.disabled, customer.restored, customer.updated, gateway.created, gateway.disabled, gateway.enabled, gateway.updated, import.processed, mandate.created, mandate.restored, mandate.revoked, payment.cancelled, payment.created, payment.retrying, payment.updated, payment_method.automatically_updated, payment_method.created, payment_method.updated, refund.approved, refund.created, refund.failed, subscription.automatically_paused, subscription.cancelled, subscription.created, subscription.finished, subscription.paused, subscription.resumed, subscription.updated, user.updated_available_brands.

secret
string <= 5000 characters

The endpoint's secret, used to generate webhook signatures.

failed_lately_count
integer <int32>
success_lately_count
integer <int32>
livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

curl --request GET \
  --url https://api.debi.pro/v1/webhooks/WHq4VzyAzDgB \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update a webhook

Updates a webhook.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: WHq4VzyAzDgB

Webhook ID.

Request Body schema: application/json
optional
url
string

Responses

Response Schema: application/json
object (Webhook)

You can configure webhook endpoints via the API to be notified about events that happen in your Debi account or connected accounts.

Most users configure webhooks from the dashboard, which provides a user interface for registering and testing your webhook endpoints.

id
string

Unique identifier for the object.

object
string
Value: "webhook"
url
string <= 5000 characters

The URL of the webhook endpoint.

enabled
boolean

Whether the webhook is enabled.

enabled_events
Array of strings

One of: checkout.session.async_payment_failed, checkout.session.async_payment_succeeded, checkout.session.completed, checkout.session.expired, customer.created, customer.disabled, customer.restored, customer.updated, gateway.created, gateway.disabled, gateway.enabled, gateway.updated, import.processed, mandate.created, mandate.restored, mandate.revoked, payment.cancelled, payment.created, payment.retrying, payment.updated, payment_method.automatically_updated, payment_method.created, payment_method.updated, refund.approved, refund.created, refund.failed, subscription.automatically_paused, subscription.cancelled, subscription.created, subscription.finished, subscription.paused, subscription.resumed, subscription.updated, user.updated_available_brands.

secret
string <= 5000 characters

The endpoint's secret, used to generate webhook signatures.

failed_lately_count
integer <int32>
success_lately_count
integer <int32>
livemode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

created_at
string <date-time>

Time at which the object was created. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

updated_at
string <date-time>

Time at which the object was last updated. Formatting follows RFC339. Example: 2015-10-21T08:29:31-03:00.

Request samples

Content type
application/json

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a webhook

Delete a webhook.

Authorizations:
SecretKeyAuthentication
path Parameters
id
required
string
Example: WHq4VzyAzDgB

Webhook ID.

Responses

Request samples

curl --request DELETE \
  --url https://api.debi.pro/v1/webhooks/WHq4VzyAzDgB \
  --header 'Authorization: Bearer sk_live_...'

Response samples

Content type
application/json
{
  • "data": {
    }
}