Crear producto
curl --request POST \
--url https://tapipay-facade.homo.tapila.cloud/products \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-authorization-token: <api-key>' \
--data '
{
"name": "<string>",
"externalProductId": "<string>",
"companyCode": "MX-S-67890",
"active": true
}
'import requests
url = "https://tapipay-facade.homo.tapila.cloud/products"
payload = {
"name": "<string>",
"externalProductId": "<string>",
"companyCode": "MX-S-67890",
"active": True
}
headers = {
"x-api-key": "<api-key>",
"x-authorization-token": "<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>',
'x-authorization-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
externalProductId: '<string>',
companyCode: 'MX-S-67890',
active: true
})
};
fetch('https://tapipay-facade.homo.tapila.cloud/products', 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://tapipay-facade.homo.tapila.cloud/products",
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([
'name' => '<string>',
'externalProductId' => '<string>',
'companyCode' => 'MX-S-67890',
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-authorization-token: <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://tapipay-facade.homo.tapila.cloud/products"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"externalProductId\": \"<string>\",\n \"companyCode\": \"MX-S-67890\",\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-authorization-token", "<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://tapipay-facade.homo.tapila.cloud/products")
.header("x-api-key", "<api-key>")
.header("x-authorization-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"externalProductId\": \"<string>\",\n \"companyCode\": \"MX-S-67890\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tapipay-facade.homo.tapila.cloud/products")
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["x-authorization-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"externalProductId\": \"<string>\",\n \"companyCode\": \"MX-S-67890\",\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"productId": "prd_12985",
"name": "<string>",
"active": true,
"externalProductId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"requestId": "<string>"
}Products
Crear producto
Crea un producto para categorizar tus cobros y devuelve lo guardado (timestamps, externalProductId, active). Es un upsert por name: si ya existe un producto activo con ese name en la company, responde 201 con el producto existente sin modificarlo. Los campos no declarados se ignoran.
POST
/
products
Crear producto
curl --request POST \
--url https://tapipay-facade.homo.tapila.cloud/products \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-authorization-token: <api-key>' \
--data '
{
"name": "<string>",
"externalProductId": "<string>",
"companyCode": "MX-S-67890",
"active": true
}
'import requests
url = "https://tapipay-facade.homo.tapila.cloud/products"
payload = {
"name": "<string>",
"externalProductId": "<string>",
"companyCode": "MX-S-67890",
"active": True
}
headers = {
"x-api-key": "<api-key>",
"x-authorization-token": "<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>',
'x-authorization-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
externalProductId: '<string>',
companyCode: 'MX-S-67890',
active: true
})
};
fetch('https://tapipay-facade.homo.tapila.cloud/products', 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://tapipay-facade.homo.tapila.cloud/products",
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([
'name' => '<string>',
'externalProductId' => '<string>',
'companyCode' => 'MX-S-67890',
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-authorization-token: <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://tapipay-facade.homo.tapila.cloud/products"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"externalProductId\": \"<string>\",\n \"companyCode\": \"MX-S-67890\",\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-authorization-token", "<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://tapipay-facade.homo.tapila.cloud/products")
.header("x-api-key", "<api-key>")
.header("x-authorization-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"externalProductId\": \"<string>\",\n \"companyCode\": \"MX-S-67890\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tapipay-facade.homo.tapila.cloud/products")
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["x-authorization-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"externalProductId\": \"<string>\",\n \"companyCode\": \"MX-S-67890\",\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"productId": "prd_12985",
"name": "<string>",
"active": true,
"externalProductId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"requestId": "<string>"
}Autorizaciones
Cuerpo
application/json
Company de Tapi en la que se crea el producto (opcional). Solo aplica si tu cliente tiene varias companies: indica para cual de ellas es el producto. Debe ser una company de tu cliente (si no, 422 RESOLUTION_ERROR). Si tu cliente tiene una sola company, se omite; si tiene varias y no se envia, la API responde 400 pidiendolo.
Ejemplo:
"MX-S-67890"

