Realizar pago
curl --request POST \
--url https://api.onepay.la/v1/utilities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency: <x-idempotency>' \
--data '
{
"provider_id": "<string>",
"reference": "<string>"
}
'import requests
url = "https://api.onepay.la/v1/utilities"
payload = {
"provider_id": "<string>",
"reference": "<string>"
}
headers = {
"x-idempotency": "<x-idempotency>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency': '<x-idempotency>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({provider_id: '<string>', reference: '<string>'})
};
fetch('https://api.onepay.la/v1/utilities', 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://api.onepay.la/v1/utilities",
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([
'provider_id' => '<string>',
'reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-idempotency: <x-idempotency>"
],
]);
$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://api.onepay.la/v1/utilities"
payload := strings.NewReader("{\n \"provider_id\": \"<string>\",\n \"reference\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency", "<x-idempotency>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.onepay.la/v1/utilities")
.header("x-idempotency", "<x-idempotency>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"provider_id\": \"<string>\",\n \"reference\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/utilities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency"] = '<x-idempotency>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider_id\": \"<string>\",\n \"reference\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "9d16af28-e289-4a24-bcc4-697febf17141",
"name": "Gulgowski and Sons",
"help_text": null
},
{
"id": "9d16af28-e319-44d3-8939-8f5286362f5d",
"name": "Pfeffer-Turner",
"help_text": null
},
{
"id": "9d16af28-e339-49d9-87d0-19e91bea48d3",
"name": "Flatley, Schmitt and McDermott",
"help_text": null
},
{
"id": "9d16af28-e36c-4d70-9dca-839b8d806ef8",
"name": "Heathcote and Sons",
"help_text": null
}
],
"current_page": 1,
"first_page_url": "https://api.onepay.test/v1/utilities/providers?page=1",
"from": 1,
"next_page_url": null,
"path": "https://api.onepay.test/v1/utilities/providers",
"per_page": 50,
"prev_page_url": null,
"to": 4
}
Realizar pago
Realiza un pago a un convenio.
POST
utilities
Realizar pago
curl --request POST \
--url https://api.onepay.la/v1/utilities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency: <x-idempotency>' \
--data '
{
"provider_id": "<string>",
"reference": "<string>"
}
'import requests
url = "https://api.onepay.la/v1/utilities"
payload = {
"provider_id": "<string>",
"reference": "<string>"
}
headers = {
"x-idempotency": "<x-idempotency>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency': '<x-idempotency>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({provider_id: '<string>', reference: '<string>'})
};
fetch('https://api.onepay.la/v1/utilities', 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://api.onepay.la/v1/utilities",
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([
'provider_id' => '<string>',
'reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-idempotency: <x-idempotency>"
],
]);
$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://api.onepay.la/v1/utilities"
payload := strings.NewReader("{\n \"provider_id\": \"<string>\",\n \"reference\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency", "<x-idempotency>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.onepay.la/v1/utilities")
.header("x-idempotency", "<x-idempotency>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"provider_id\": \"<string>\",\n \"reference\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/utilities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency"] = '<x-idempotency>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider_id\": \"<string>\",\n \"reference\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "9d16af28-e289-4a24-bcc4-697febf17141",
"name": "Gulgowski and Sons",
"help_text": null
},
{
"id": "9d16af28-e319-44d3-8939-8f5286362f5d",
"name": "Pfeffer-Turner",
"help_text": null
},
{
"id": "9d16af28-e339-49d9-87d0-19e91bea48d3",
"name": "Flatley, Schmitt and McDermott",
"help_text": null
},
{
"id": "9d16af28-e36c-4d70-9dca-839b8d806ef8",
"name": "Heathcote and Sons",
"help_text": null
}
],
"current_page": 1,
"first_page_url": "https://api.onepay.test/v1/utilities/providers?page=1",
"from": 1,
"next_page_url": null,
"path": "https://api.onepay.test/v1/utilities/providers",
"per_page": 50,
"prev_page_url": null,
"to": 4
}
Headers
string
required
Token único para garantizar la idempotencia de la petición
Body
string
required
UUID del convenio listado previamente que se desea pagar.
string
required
Referencia de pago para el convenio. de ejemplo puedes usar 111100005555
{
"data": [
{
"id": "9d16af28-e289-4a24-bcc4-697febf17141",
"name": "Gulgowski and Sons",
"help_text": null
},
{
"id": "9d16af28-e319-44d3-8939-8f5286362f5d",
"name": "Pfeffer-Turner",
"help_text": null
},
{
"id": "9d16af28-e339-49d9-87d0-19e91bea48d3",
"name": "Flatley, Schmitt and McDermott",
"help_text": null
},
{
"id": "9d16af28-e36c-4d70-9dca-839b8d806ef8",
"name": "Heathcote and Sons",
"help_text": null
}
],
"current_page": 1,
"first_page_url": "https://api.onepay.test/v1/utilities/providers?page=1",
"from": 1,
"next_page_url": null,
"path": "https://api.onepay.test/v1/utilities/providers",
"per_page": 50,
"prev_page_url": null,
"to": 4
}
Was this page helpful?
⌘I