Introduction
This document describes the TotalCoin API endpoints for managing cashin events with automatic reconciliation. In this scenario there are two actors, TotalCoin clients and users of that client, so the following scenarios can occur:
- The TotalCoin client generates a pre-order, and then their user makes the payment. TotalCoin receives the payment, performs automatic reconciliation and notifies the client by calling the corresponding webhook.
- TotalCoin receives a payment from a user, and notifies the client about the payment, the client calls the automatic reconciliation endpoint and TotalCoin calls the client webhook once reconciliation is completed.
Regardless of the scenario, the flow would be the same but at different times. Check this when implementing with the TotalCoin team.
Authentication
API access control is done through OAuth 2.0 with Bearer Tokens.
Endpoint
Request
{ "username": "", "password": "" }
Field | Type | Description | Required |
---|---|---|---|
username | String | Username | Yes |
password | String | Password | Yes |
Response (HTTP 200)
{ "token": "", "expires_in": 3600 }
Field | Type | Description |
---|---|---|
token | String | Authentication token |
expires_in | Number | Token validity in seconds |
Possible Errors
Code | Description |
---|---|
401 | Invalid or non-existent credentials |
403 | No permissions to access the API |
Create Pre-Order
This endpoint creates a pre-order, meaning the client notifies TotalCoin that a possible payment will be made in the near future.
Endpoint
Request
{ "OperationId": "string", "Amount": 0, "DNI": "string", "CompanyReferenceToConciliate": "string" }
Field | Type | Description | Required |
---|---|---|---|
OperationId | String | Represents the external reference that will be used for reconciliation. | Yes |
Amount | Number | Must match the gross amount sent by the client. | Yes |
Dni | String | Can be DNI or CUIT of the person who sent the money | Yes |
CompanyReferenceToConciliate | String | This value must be empty in the pre-order | Yes |
Response (HTTP 201)
True or False
Possible Errors
Code | Description |
---|---|
400 | Invalid request parameters |
401 | Unauthorized - Invalid or missing token |
403 | Forbidden - Insufficient permissions |
Webhook Notifications
The notification webhook is called when a payment is received either through a transfer, QR payment, or card payment.
Or also when automatic reconciliation of the pre-order is performed.
Webhook Payload
{ "Concepto": "1234567890", "Referencia": "0000004053", "Monto": 1000, "MontoNeto": 937.2, "Tarifas": 51.9, "Impuestos": 10.9, "FechaCreacion": "11/19/2020 16:40:20", "FechaConfirmacion": "11/19/2020 16:40:23", "FechaAcreditacion": "04/21/2021 14:34:53", "Estado": "APROBADO", "MetodoPago": "TARJETA", "Operacion": "COBRANZA TARJETA", "NombreCompletoEmisor": "TOTAL COIN", "EmailEmisor":"@totalcoin.com", "NombreCompletoReceptor": "TOTAL COIN", "EmailReceptor": "@totalcoin.com", "CuilCuitEmisor": "11111111", "CuilCuitReceptor": "11111111", "BarCode": null, "CbuOrigen": "", "CvuOrigen": null, "Tarjeta": "VISA", "Cuotas": "02", "ReferenciaMerchant": null }
Most important fields of that body are:
Field | Description |
---|---|
Referencia | Internal and unique reference number of Totalcoin transaction |
Monto | Amount |
Estado | Last status of the operation |
ReferenciaMerchant | Merchant IdOperacion |