Referencia técnica / Integración emisores

Cómo iniciar

Proceso de integración

1.- Solicita tu API Key y URL de integración.

2.- Desarrolla en ambiente sandbox. Esta es la guía para hacerlo.

3.- Cuando estés listo validarémos y certificarémos tu integración. Al finalizar recibirás tu API Key y URL del ambiente productivo.

4.- Implementemos en producción tu desarrollo.

5.- Listo para recibir pagos en efectivo con PayCash.



Modo de uso

1.- Autenticarse como usuario de la plataforma PayCash haciendo uso del método authre. Es necesario contar con tu API Key para solicitar un token, el cual será usado en el resto de los métodos involucrados.

2.- Para generar una referencia PayCash basta con solicitarlo a través del método reference. Este método responderá con la referencia PayCash. Utilice el método searchreference para conocer las caracteristicas de la referencia PayCash. Si por alguna razón necesita cancelar la referencia, haga uso del método cancel, unicamente si la referencia no tiene pagos.

3.- Utilice método payments para consultar los pagos realizados a las referencias PayCash.

Consumo de API's

Obtener token / authre

Para realizar peticiones a la API de PayCash, es necesario contar con tu llave privada, con esta llave podrás obtener un token, el cual es requerido al momento de hacer la solicitud de alguno de los métodos contenidos en este documento. Esta llave privada es configurada para ser utilizada ya sea en modo sandbox o producción. Asegúrate de nunca compartir tu llave privada con nadie, ya que podrían tener accesos a tu cuenta PayCash.

Al hacer la solicitud del token se valida que la llave privada exista, este vigente y corresponda al ambiente sandbox o productivo.


/authre

Ejemplos de uso y SDK

curl --location --request GET 'https://sb-api-pais-emisor.paycashglobal.com/v1/authre?key='
#Es necesario reemplazar 'pais' por tu país en la URL
//Este ejemplo requiere de la librería OkHttp para JAVA
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://sb-api-pais-emisor.paycashglobal.com/v1/authre?key=") //Es necesario reemplazar 'pais' por tu país en la URL
  .method("GET", null)
  .build();
Response response = client.newCall(request).execute();
import io.swagger.client.api.AuthreApi;

public class AuthreApiExample {

    public static void main(String[] args) {
        AuthreApi apiInstance = new AuthreApi();
        String key = key_example; // String | Unique key to business partner , from PayCash Global.
        String expirationdate = expirationdate_example; // String | Token expiration date.
        Boolean unique = true; // Boolean | Token type "unique".
        try {
            array[RespAuther] result = apiInstance.getToken(key, expirationdate, unique);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthreApi#getToken");
            e.printStackTrace();
        }
    }
}
//Este ejemplo requiere de la librería NSURLSession para Obj-C
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sb-api-pais-emisor.paycashglobal.com/v1/authre?key="] //Es necesario reemplazar 'pais' por tu país en la URL
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];

[request setHTTPMethod:@"GET"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var requestOptions = {
  method: 'GET',
  redirect: 'follow'
};

fetch("https://sb-api-pais-emisor.paycashglobal.com/v1/authre?key=", requestOptions) //Es necesario reemplazar 'pais' por tu país en la URL
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
//Este ejemplo requiere de la librería RestSharp para C#
var client = new RestClient("https://sb-api-pais-emisor.paycashglobal.com/v1/authre?key="); //Es necesario reemplazar 'pais' por tu país en la URL
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
//Este ejemplo requiere de la librería cURL para PHP
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sb-api-pais-emisor.paycashglobal.com/v1/authre?key=', //Es necesario reemplazar 'pais' por tu país en la URL
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AuthreApi;

my $api_instance = WWW::SwaggerClient::AuthreApi->new();
my $key = key_example; # String | Unique key to business partner , from PayCash Global.
my $expirationdate = expirationdate_example; # String | Token expiration date.
my $unique = true; # Boolean | Token type "unique".

eval { 
    my $result = $api_instance->getToken(key => $key, expirationdate => $expirationdate, unique => $unique);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AuthreApi->getToken: $@\n";
}
#Este ejemplo requiere de la librería http.client para Python
import http.client

conn = http.client.HTTPSConnection("sb-api-pais-emisor.paycashglobal.com") #Es necesario reemplazar 'pais' por tu país en la URL
payload = ''
headers = {}
conn.request("GET", "/v1/authre?key=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parámetros

Header
Nombre Descripción
key*
String
Clave única para el socio comercial, de PayCash Global.
Obligatorio
Query
Nombre Descripción
expirationdate
String (yyyy/MM/dd)
Fecha de expiración del token.
unique
Boolean
Tipo de token "unique".

Responses

Status: 200 - Successful Process

Status: 400 - Internal Server Error.


Crear referencia / reference

Use este método para crear una referencia PayCash.

Al usar este método considerar que las referencias PayCash pueden ser:

- De monto fijo o de monto abierto.
- Con o sin fecha de vencimiento.
- De pago único o recurrente.
- Que los anteriores atributos se pueden combinar.


/reference

Ejemplos de uso y SDK

curl --location --request POST 'https://sb-api-pais-emisor.paycashglobal.com/v1/reference' \ #Es necesario reemplazar 'pais' por tu país en la URL
--header 'Authorization: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Amount":"",
    "ExpirationDate":"",
    "Value":"",
    "Type":""
}'
//Este ejemplo requiere de la librería OkHttp para JAVA
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n    \"Amount\":\"\",\r\n    \"ExpirationDate\":\"\",\r\n    \"Value\":\"\",\r\n    \"Type\":\"\"\r\n}");
Request request = new Request.Builder()
  .url("https://sb-api-pais-emisor.paycashglobal.com/v1/reference") //Es necesario reemplazar 'pais' por tu país en la URL
  .method("POST", body)
  .addHeader("Authorization", "")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
import io.swagger.client.api.EmisorApi;

public class EmisorApiExample {

  public static void main(String[] args) {
      EmisorApi apiInstance = new EmisorApi();
      String authorization = authorization_example; // String | Token to business partner , from PayCash Global.
      BodyCreateRef body = ; // BodyCreateRef | por definir
      try {
          array[RespCreateRef] result = apiInstance.referenceCreate(authorization, body);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling EmisorApi#referenceCreate");
          e.printStackTrace();
      }
  }
}
//Este ejemplo requiere de la librería NSURLSession para Obj-C
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sb-api-pais-emisor.paycashglobal.com/v1/reference"] //Es necesario reemplazar 'pais' por tu país en la URL
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"",
  @"Content-Type": @"application/json"
};

[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\r\n    \"Amount\":\"\",\r\n    \"ExpirationDate\":\"\",\r\n    \"Value\":\"\",\r\n    \"Type\":\"\"\r\n}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var myHeaders = new Headers();
myHeaders.append("Authorization", "");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "Amount": "",
  "ExpirationDate": "",
  "Value": "",
  "Type": ""
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://sb-api-pais-emisor.paycashglobal.com/v1/reference", requestOptions) //Es necesario reemplazar 'pais' por tu país en la URL
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
//Este ejemplo requiere de la librería RestSharp para C#
var client = new RestClient("https://sb-api-pais-emisor.paycashglobal.com/v1/reference"); //Es necesario reemplazar 'pais' por tu país en la URL
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@"    ""Amount"":"""",
" + "\n" +
@"    ""ExpirationDate"":"""",
" + "\n" +
@"    ""Value"":"""",
" + "\n" +
@"    ""Type"":""""
" + "\n" +
@"}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
//Este ejemplo requiere de la librería cURL para PHP
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sb-api-pais-emisor.paycashglobal.com/v1/reference', //Es necesario reemplazar 'pais' por tu país en la URL
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "Amount":"",
    "ExpirationDate":"",
    "Value":"",
    "Type":""
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: ',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EmisorApi;

my $api_instance = WWW::SwaggerClient::EmisorApi->new();
my $authorization = authorization_example; # String | Token to business partner , from PayCash Global.
my $body = WWW::SwaggerClient::Object::BodyCreateRef->new(); # BodyCreateRef | por definir

eval { 
  my $result = $api_instance->referenceCreate(authorization => $authorization, body => $body);
  print Dumper($result);
};
if ($@) {
  warn "Exception when calling EmisorApi->referenceCreate: $@\n";
}
#Este ejemplo requiere de la librería http.client para Python
import http.client
import json

conn = http.client.HTTPSConnection("sb-api-pais-emisor.paycashglobal.com") #Es necesario reemplazar 'pais' por tu país en la URL
payload = json.dumps({
  "Amount": "",
  "ExpirationDate": "",
  "Value": "",
  "Type": ""
})
headers = {
  'Authorization': '',
  'Content-Type': 'application/json'
}
conn.request("POST", "/v1/reference", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parámetros

Header
Nombre Descripción
authorization*
String
Token obtenido al momento de autenticarse. Resultado de ejecutar el método para obtener el token (authre).
Obligatorio
Body
Nombre Descripción
body

Respuestas

Status: 200 - Successful Process

Status: 400 - Internal Server Error.


Buscar referencia / search

Use este método para buscar una referencia PayCash.

Este método proporciona información general de la manera en la que se creó la referencia:

- Si es de monto fijo o abierto.
- Con o sin fecha de vencimiento.
- Si es de pago único o recurrente.
- Monto, fecha de creación, si está activa o cancelada, etc.


/search

Ejemplos de uso y SDK

curl --location --request GET 'https://sb-api-pais-emisor.paycashglobal.com/v1/search?Reference=' \ #Es necesario reemplazar 'pais' por tu país en la URL
--header 'Authorization: '
//Este ejemplo requiere de la librería OkHttp para JAVA
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://sb-api-pais-emisor.paycashglobal.com/v1/search?Reference=") //Es necesario reemplazar 'pais' por tu país en la URL
  .method("GET", null)
  .addHeader("Authorization", "")
  .build();
Response response = client.newCall(request).execute();
import io.swagger.client.api.EmisorApi;

public class EmisorApiExample {

  public static void main(String[] args) {
      EmisorApi apiInstance = new EmisorApi();
      String authorization = authorization_example; // String | Token to business partner , from PayCash Global.
      String reference = reference_example; // String | Reference to cancel
      try {
          array[RespSearchRef] result = apiInstance.searchReference(authorization, reference);
          System.out.println(result);
      } catch (ApiException e) {
          System.err.println("Exception when calling EmisorApi#searchReference");
          e.printStackTrace();
      }
  }
}
//Este ejemplo requiere de la librería NSURLSession para Obj-C
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sb-api-pais-emisor.paycashglobal.com/v1/search?Reference="] //Es necesario reemplazar 'pais' por tu país en la URL
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @""
};

[request setAllHTTPHeaderFields:headers];

[request setHTTPMethod:@"GET"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var myHeaders = new Headers();
myHeaders.append("Authorization", "");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://sb-api-pais-emisor.paycashglobal.com/v1/search?Reference=", requestOptions) //Es necesario reemplazar 'pais' por tu país en la URL
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
//Este ejemplo requiere de la librería RestSharp para C#
var client = new RestClient("https://sb-api-pais-emisor.paycashglobal.com/v1/search?Reference="); //Es necesario reemplazar 'pais' por tu país en la URL
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
//Este ejemplo requiere de la librería cURL para PHP
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sb-api-pais-emisor.paycashglobal.com/v1/search?Reference=', //Es necesario reemplazar 'pais' por tu país en la URL
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: '
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EmisorApi;

my $api_instance = WWW::SwaggerClient::EmisorApi->new();
my $authorization = authorization_example; # String | Token to business partner , from PayCash Global.
my $reference = reference_example; # String | Reference to cancel

eval { 
  my $result = $api_instance->searchReference(authorization => $authorization, reference => $reference);
  print Dumper($result);
};
if ($@) {
  warn "Exception when calling EmisorApi->searchReference: $@\n";
}
#Este ejemplo requiere de la librería http.client para Python
import http.client

conn = http.client.HTTPSConnection("sb-api-pais-emisor.paycashglobal.com") #Es necesario reemplazar 'pais' por tu país en la URL
payload = ''
headers = {
  'Authorization': ''
}
conn.request("GET", "/v1/search?Reference=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parámetros

Header
Nombre Descripción
authorization*
String
Token obtenido al momento de autenticarse. Resultado de ejecutar el método para obtener el token (authre).
Obligatorio
Query
Nombre Descripción
Reference
String
Referencia PayCash a buscar.

Responses

Status: 200 - Successful Process

Status: 400 - Internal Server Error.


Cancelar referencia / cancel

Use este método para cancelar una referencia creada.

Al usar este método se valida lo siguiente de la referencia:

- Que sea del emisor
- Que no esté pagada.
- Que no esté previamente cancelada.


/cancel

Ejemplos de uso y SDK

curl --location --request POST 'https://sb-api-pais-emisor.paycashglobal.com/v1/cancel' \ #Es necesario reemplazar 'pais' por tu país en la URL
--header 'Authorization: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Reference":""
}'
//Este ejemplo requiere de la librería OkHttp para JAVA
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n    \"Reference\":\"\"\r\n}");
Request request = new Request.Builder()
  .url("https://sb-api-pais-emisor.paycashglobal.com/v1/cancel") //Es necesario reemplazar 'pais' por tu país en la URL
  .method("POST", body)
  .addHeader("Authorization", "")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
import io.swagger.client.api.EmisorApi;

public class EmisorApiExample {

    public static void main(String[] args) {
        EmisorApi apiInstance = new EmisorApi();
        String authorization = authorization_example; // String | Token to business partner , from PayCash Global.
        String reference = reference_example; // String | Reference to cancel
        try {
            array[RespCancelRef] result = apiInstance.referenceCancel(authorization, reference);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EmisorApi#referenceCancel");
            e.printStackTrace();
        }
    }
}
//Este ejemplo requiere de la librería NSURLSession para Obj-C
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sb-api-pais-emisor.paycashglobal.com/v1/cancel"] //Es necesario reemplazar 'pais' por tu país en la URL
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @"",
  @"Content-Type": @"application/json"
};

[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\r\n    \"Reference\":\"\"\r\n}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];

[request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var myHeaders = new Headers();
myHeaders.append("Authorization", "");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "Reference": ""
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://sb-api-pais-emisor.paycashglobal.com/v1/cancel", requestOptions) //Es necesario reemplazar 'pais' por tu país en la URL
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
//Este ejemplo requiere de la librería RestSharp para C#
var client = new RestClient("https://sb-api-pais-emisor.paycashglobal.com/v1/cancel"); //Es necesario reemplazar 'pais' por tu país en la URL
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@"    ""Reference"":""""
" + "\n" +
@"}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
//Este ejemplo requiere de la librería cURL para PHP
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sb-api-pais-emisor.paycashglobal.com/v1/cancel', //Es necesario reemplazar 'pais' por tu país en la URL
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "Reference":""
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: ',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EmisorApi;

my $api_instance = WWW::SwaggerClient::EmisorApi->new();
my $authorization = authorization_example; # String | Token to business partner , from PayCash Global.
my $reference = reference_example; # String | Reference to cancel

eval { 
    my $result = $api_instance->referenceCancel(authorization => $authorization, reference => $reference);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling EmisorApi->referenceCancel: $@\n";
}
#Este ejemplo requiere de la librería http.client para Python
import http.client
import json

conn = http.client.HTTPSConnection("sb-api-pais-emisor.paycashglobal.com") #Es necesario reemplazar 'pais' por tu país en la URL
payload = json.dumps({
  "Reference": ""
})
headers = {
  'Authorization': '',
  'Content-Type': 'application/json'
}
conn.request("POST", "/v1/cancel", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parámetros

Header
Nombre Descripción
authorization*
String
Token obtenido al momento de autenticarse. Resultado de ejecutar el método para obtener el token (authre).
Obligatorio
Body Json
Nombre Descripción
Reference
String
Referencia PayCash a cancelar.

Respuestas

Status: 200 - Successful Process

Status: 400 - Internal Server Error.


Consultar pagos / payments

Consulta los pagos de referencias realizados en una fecha específica a partir de una hora.

Esté método generalmente es usado cuando el emisor está interesado en conocer si sus referencias ya fueron pagadas.
Queda del lado del emisor el implementar este mecanismo de búsqueda.
Para este escenario se recomienda solicitar la habilitación de la notificación de pago automatica a través de webHooks.


/payments

Ejemplos de uso y SDK

curl --location --request GET 'https://sb-api-pais-emisor.paycashglobal.com/v1/payments?Date=&Hour=' \ #Es necesario reemplazar 'pais' por tu país en la URL
--header 'Authorization: '
//Este ejemplo requiere de la librería OkHttp para JAVA
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://sb-api-pais-emisor.paycashglobal.com/v1/payments?Date=&Hour=") //Es necesario reemplazar 'pais' por tu país en la URL
  .method("GET", null)
  .addHeader("Authorization", "")
  .build();
Response response = client.newCall(request).execute();
import io.swagger.client.api.EmisorApi;
  
  public class EmisorApiExample { 
      public static void main(String[] args) {
          EmisorApi apiInstance = new EmisorApi();
          String authorization = authorization_example; // String | Token to business partner , from PayCash Global.
          String Date = date_example; // String | Date to yyyy-mm-dd
          String Hour = hour_example; // String | Hour to HH:MM:ss 
          try {
              array[RespPayments] result = apiInstance.Payments(authorization,Date,Hour);
              System.out.println(result);
          } catch (ApiException e) {
              System.err.println("Exception when calling EmisorApi#Payments");
              e.printStackTrace();
          }
      }
  }
//Este ejemplo requiere de la librería NSURLSession para Obj-C
#import <Foundation/Foundation.h>

dispatch_semaphore_t sema = dispatch_semaphore_create(0);

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sb-api-pais-emisor.paycashglobal.com/v1/payments?Date=&Hour="] //Es necesario reemplazar 'pais' por tu país en la URL
  cachePolicy:NSURLRequestUseProtocolCachePolicy
  timeoutInterval:10.0];
NSDictionary *headers = @{
  @"Authorization": @""
};

[request setAllHTTPHeaderFields:headers];

[request setHTTPMethod:@"GET"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
  if (error) {
    NSLog(@"%@", error);
    dispatch_semaphore_signal(sema);
  } else {
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
    NSError *parseError = nil;
    NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
    NSLog(@"%@",responseDictionary);
    dispatch_semaphore_signal(sema);
  }
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var myHeaders = new Headers();
myHeaders.append("Authorization", "");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://sb-api-pais-emisor.paycashglobal.com/v1/payments?Date=&Hour=", requestOptions) //Es necesario reemplazar 'pais' por tu país en la URL
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
//Este ejemplo requiere de la librería RestSharp para C#
var client = new RestClient("https://sb-api-pais-emisor.paycashglobal.com/v1/payments?Date=&Hour="); //Es necesario reemplazar 'pais' por tu país en la URL
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
//Este ejemplo requiere de la librería cURL para PHP
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sb-api-pais-emisor.paycashglobal.com/v1/payments?Date=&Hour=', //Es necesario reemplazar 'pais' por tu país en la URL
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: '
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
use Data::Dumper;
  use WWW::SwaggerClient::Configuration;
  use WWW::SwaggerClient::EmisorApi;
  
  my $api_instance = WWW::SwaggerClient::EmisorApi->new();
  my $authorization = authorization_example; # String | Token to business partner , from PayCash Global.
  my $Date = date_example; # String | Date to yyyy-mm-dd
  my $Hour = date_example; # String | Hour to HH:MM:ss
  
  eval { 
      my $result = $api_instance->Payments(authorization => $authorization, Date => $date,Hour => $hour);
      print Dumper($result);
  };
  if ($@) {
      warn "Exception when calling EmisorApi->Payments: $@\n";
  }
#Este ejemplo requiere de la librería http.client para Python
import http.client

conn = http.client.HTTPSConnection("sb-api-pais-emisor.paycashglobal.com") #Es necesario reemplazar 'pais' por tu país en la URL
payload = ''
headers = {
  'Authorization': ''
}
conn.request("GET", "/v1/payments?Date=&Hour=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parámetros

Header
Nombre Descripción
authorization*
String
Token obtenido al momento de autenticarse. Resultado de ejecutar el método para obtener el token (authre).
Obligatorio
Query
Nombre Descripción
Date
String
Fecha en la que se desea consultar los pagos.
-Formato: YYYY-mm-dd
Obligatorio
Hour
String
Hora a partir de la cual se hace la consulta de pagos.
-Formato: hh:mm:ss
Obligatorio

Responses

Status: 200 - Successful Process

Status: 400 - Internal Server Error.

Códigos de respuesta

API REST México

Propósito

Identificar los códigos de respuesta que existen para cada método.

La siguiente tabla muestra los códigos de respuesta que existen para cada método.






No. Método Código Mensaje de respuesta
1 Authre 0 Operacion Exitosa.
2 111 Error General. El acceso para generar el token es invalido.
3 111 Error General. Llave de usuario es invalida.
4 Cancel 0 Operacion Exitosa.
5 51 existe un pago confirmado, no se puede cancelar
6 61 la operacion no existe.
7 71 la operacion ha sido previamente cancelada.
8 Search 0 Operacion Exitosa.
9 102 Error General. AuthCode es invalido.
10 102 Error General. AuthCode Estatus invalido.
11 102 Error General. AuthCode type es invalido.
12 102 Error General. AuthCode ha expirado.
13 102 Error General. Referencia invalida.
14 102 Error General. Referencia no corresponde al Emisor.
15 102 Error General. El emisor indicado no es valido.
16 102 Error General. Estatus de emisor invalido.
17 Reference 0 Operacion Exitosa.
18 22 El emisor indicado no es valido.
19 23 Error en tipo de referencia, por favor verifique datos.
20 24 Error. No es posible generar la referencia.
21 25 Monto invalido, monto superior al maximo configurado.
22 Reversepayment SC 0 Operacion Exitosa.
23 0 El pago ya fue procesado.
24 50 Operacion invalida o previamente cancelada.
25 50 Tiempo maximo para reverso ha expirado.
26 61 La operacion no existe.
27 71 La operacion no existe.
28 API 150 Error Service.
Nota: Los mensajes de respuesta se muestran intencionalmente sin acentos.



API REST Latam

Propósito

Identificar los códigos de respuesta que existen para cada método.

La siguiente tabla muestra los códigos de respuesta que existen para cada método.

No. Método Código Mensaje de respuesta
1 Authre 0 Operacion Exitosa.
2 111 Error General. El acceso para generar el token es invalido.
3 111 Error General. Llave de usuario es invalida.
4 Reference 0 Operacion Exitosa.
5 101 Error General. AuthCode es invalido.
6 101 Error General. AuthCode Estatus invalido.
7 101 Error General. AuthCode type es invalido.
8 101 Error General. AuthCode ha expirado.
9 101 Error General. El emisor indicado no es valido.
10 101 Error General. Estatus de emisor invalido.
11 101 Error General. El pais indicado no es valido.
12 101 Error General. Estatus de pais invalido.
13 101 Error General. Parametro invalido.
14 101 Error General. Monto Invalido, Monto superior al maximo configurado.
15 101 Error General. Referencia Invalida o duplicada.
16 Search 0 Operacion Exitosa.
17 102 Error General. Authcode es invalido.
18 102 Error General. AuthCode Estatus invalido.
19 102 Error General. AuthCode type es invalido.
20 102 Error General. Referencia invalida.
21 102 Error General. Referencia invalida.
22 102 Error General. El emisor indicado no es valido.
23 102 Error General. Estatus del emisor invalido.
24 Cancel 0 Operacion Exitosa.
25 102 Error General. AuthCode es invalido.
26 102 Error General. AuthCode Estatus invalido.
27 102 Error General. AuthCode ha expirado.
28 102 Error General. Referencia invalida.
29 102 Error General. Referencia con Estatus no valido.
30 102 Error General. Referencia no corresponde al emisor.
31 102 Error General. El emisor indicado no es valido.
32 102 Error General. Estatus del emisor invalido.
33 102 Error General. Referencia previamente eliminada.
34 Payments 0 Operacion Exitosa.
35 105 Error General. AuthCode es invalido.
36 105 Error General. AuthCode Estatus invalido.
37 105 Error General. AuthCode type es invalido.
38 105 Error General. AuthCode ha expirado.
39 105 Error General. Comercio indicado no es valido.
40 105 Error General. Estatus de cadena invalido.
41 105 Error General. La operación no existe.
42 API 150 Error Service.
Nota: Los mensajes de respuesta se muestran intencionalmente sin acentos.