curl --request POST \
--url https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{}'import requests
url = "https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer"
payload = {}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "AWAITING_TRANSFER",
"rail": "SPEI",
"clabe": "738180000000012345",
"clabeLast4": "2345",
"bank": "FINTOC",
"beneficiary": "Sharepay SA de CV",
"concept": "Compra Mueblería Sol 3F2A1B",
"amount": 12000,
"amountReceived": 0,
"amountDue": 12000,
"currency": "MXN",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>"
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "AWAITING_TRANSFER",
"rail": "SPEI",
"clabe": "738180000000012345",
"clabeLast4": "2345",
"bank": "FINTOC",
"beneficiary": "Sharepay SA de CV",
"concept": "Compra Mueblería Sol 3F2A1B",
"amount": 12000,
"amountReceived": 0,
"amountDue": 12000,
"currency": "MXN",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Get or create the CLABE
Returns the live CLABE of the one-time payment, or makes a new one when it has none or the last one expired. Asking again while the CLABE is live returns the same one, so a retry never makes a second. The CLABE always belongs to the one-time payment: when the customer pays, it is paid like any other.
curl --request POST \
--url https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{}'import requests
url = "https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer"
payload = {}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/bank-transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "AWAITING_TRANSFER",
"rail": "SPEI",
"clabe": "738180000000012345",
"clabeLast4": "2345",
"bank": "FINTOC",
"beneficiary": "Sharepay SA de CV",
"concept": "Compra Mueblería Sol 3F2A1B",
"amount": 12000,
"amountReceived": 0,
"amountDue": 12000,
"currency": "MXN",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>"
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "AWAITING_TRANSFER",
"rail": "SPEI",
"clabe": "738180000000012345",
"clabeLast4": "2345",
"bank": "FINTOC",
"beneficiary": "Sharepay SA de CV",
"concept": "Compra Mueblería Sol 3F2A1B",
"amount": 12000,
"amountReceived": 0,
"amountDue": 12000,
"currency": "MXN",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Cuerpo
Respuesta
The live CLABE, asked for before.
The CLABE of a one-time payment: what your own screen shows the customer to pay by SPEI.
Where the CLABE stands. AWAITING_TRANSFER: it takes money and the payment is not paid yet. PAID: the transfer arrived and became a payment. EXPIRED: nothing arrived before expiresAt. CANCELLED: the payment was paid another way, or stopped being payable, before anything arrived. RETURNED: what arrived went back to whoever sent it, for example part of the price when the CLABE expired.
AWAITING_TRANSFER, PAID, EXPIRED, CANCELLED, RETURNED