Suscripciones con wallet
El módulo de suscripciones permite guardar y vincular las tarjetas a nivel suscriptor mediante la funcionalidad "Wallet".
De esta forma, al crear diferentes suscriptores con el mismo valor de referencia "customerReference", es posible seleccionar y modificar las tarjetas compartidas entre los mismos.
Ejemplo: Creación de Suscripción con Wallet
Cuando se crea una suscripción con Wallet se debe enviar el parámetro adicional walleten "true":
{
"total": 1000,
"currency": "ARS",
"name": "Suscripción con wallet",
"description": "Mobbex.dev",
"interval": "1m",
"trial": 0,
"reference": "subscription_A00111223",
"type": "manual",
"test": true,
"return_url": " https://mobbex.com",
"webhook": "https://webhook.com",
"wallet": true
}
Respuesta
{
"result": true,
"data": {
"uid": "H4QAGHOPE9QW6CUKVO",
"name": "Suscripción con wallet",
"description": "Mobbex.dev",
"interval": "1m",
"initialDay": -1,
"total": 1000,
"trial": 0,
"setupFee": 0,
"charge": "total",
"ccCutoffDay": -1,
"url": "https://mobbex.com/p/subscriptions/subscribe/H4QAGHOPE9QW6CUKVO",
"return_url": " https://mobbex.com",
"webhook": "https://webhook.com",
"shorten_url": "https://mobbex.com/p/subscriptions/subscribe/H4QAGHOPE9QW6CUKVO",
"test": true
}
}Ejemplo: Crear Suscriptor con Wallet
Llamando a la API de crear suscriptor, se debe agregar el parámetro "customerReference" válido que será la referencia del cliente en la wallet. Múltiples Suscriptores podrán hacer referencia al mismo Customer en la Wallet.
{
"customer":{
"email":"[email protected]",
"identification":"12123123",
"name":"Test Mobbex"
},
"reference": "R2332112121234",
"customerReference": "CR2332112121234",
"startDate":{
"day": 4,
"month": 2
}
}Respuesta
{
"result": true,
"data": {
"uid": "4QRF2DC5L8YUPIYQGY",
"reference": "R2332112121234",
"sourceUrl": "https://mobbex.com/p/subscriptions/H4QAGHOPE9QW6CUKVO/subscriber/4QRF2DC5L8YUPIYQGY/source",
"secondarySourceUrl": "https://mobbex.com/p/subscriptions/H4QAGHOPE9QW6CUKVO/subscriber/4QRF2DC5L8YUPIYQGY/source/secondary",
"subscriberUrl": "https://mobbex.com/p/subscriptions/H4QAGHOPE9QW6CUKVO/subscriber/4QRF2DC5L8YUPIYQGY",
"subscription": {
"uid": "H4QAGHOPE9QW6CUKVO"
}
}
}Obtener información con Wallet
- REF:stringrequiredDescription
- x-api-keystringrequiredDescription
- x-access-tokenstringrequiredDescription
var data = JSON.stringify({
"customer":{
"email":"[email protected]",
"identification":"12123123",
"name":"Test Mobbex"
},
"startDate":{
"day":27,
"month":3,
"year":2021
},
"reference":"233211212"});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber");
xhr.setRequestHeader("x-api-key", "zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj");
xhr.setRequestHeader("x-access-token", "d31f0721-2f85-44e7-bcc6-15e19d1a53cc");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber',
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 =>'{
"customer":{
"email": "[email protected]",
"identification": "12123123",
"name": "Test Mobbex"
},
"startDate":{
"day": 27,
"month": 3,
"year": 2021
},
"reference": "233211212"
}',
CURLOPT_HTTPHEADER => array(
'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',
'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber"
payload="{\r\n \"customer\":{\r\n \"email\": \"[email protected]\",\r\n \"identification\": \"12123123\",\r\n \"name\": \"Test Mobbex\"\r\n },\r\n \"startDate\":{\r\n \"day\": 27,\r\n \"month\": 3,\r\n \"year\": 2021\r\n },\r\n \"reference\": \"233211212\"\r\n}"
headers = {
'x-api-key': 'zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',
'x-access-token': 'd31f0721-2f85-44e7-bcc6-15e19d1a53cc',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
{
"result": true,
"data": {
"uid": "Y7B3P541B9VFBYTHSZ",
"reference": "233211212",
"sourceUrl": "https://mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber/Y7B3P541B9VFBYTHSZ/source",
"subscriberUrl": "https://mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber/Y7B3P541B9VFBYTHSZ",
"subscription": {
"uid": "T691POMK62SGC7CHAK"
}
}
}Ejemplo Obtener información con Wallet
GET https://api.mobbex.com/p/wallet/REF:CR2332112121234
Respuesta
{
"result": true,
"data": {
"uid": "4MR1URZ4D8FILOMNPU",
"reference": "CR2332112121234",
"test": true,
"customerData": {
"email": "[email protected]",
"identification": "12123123",
"name": "Test Demo"
},
"features": [],
"status": "active",
"sources": [
{
"uid": "W:T3J9TBMJFLVKU846WE",
"name": "Tarjeta terminada en 6691",
"type": "card",
"priority": "primary",
"card": {
"number": "47654068****6691",
"bin": "47654068",
"last4": "6691"
}
},
{
"uid": "W:36IXF2D0GYABJJYKXP",
"name": "Tarjeta terminada en 1008",
"type": "card",
"priority": "secondary",
"card": {
"number": "53236299****1008",
"bin": "53236299",
"last4": "1008"
}
}
],
"updated": "2025-02-04T17:40:14.689Z",
"created": "2025-02-04T17:40:14.689Z"
}
}Cambio de método de pago via Wallet
- sidstringrequiredDescription
- subidstringrequiredDescription
- x-api-keystringrequiredDescription
- x-access-tokenstringrequiredDescription
- tokenstringrequiredDescription
- securityCodestringrequiredDescription
var data = JSON.stringify({
"customer":{
"email":"[email protected]",
"identification":"12123123",
"name":"Test Mobbex"
},
"startDate":{
"day":27,
"month":3,
"year":2021
},
"reference":"233211212"});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber");
xhr.setRequestHeader("x-api-key", "zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj");
xhr.setRequestHeader("x-access-token", "d31f0721-2f85-44e7-bcc6-15e19d1a53cc");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber',
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 =>'{
"customer":{
"email": "[email protected]",
"identification": "12123123",
"name": "Test Mobbex"
},
"startDate":{
"day": 27,
"month": 3,
"year": 2021
},
"reference": "233211212"
}',
CURLOPT_HTTPHEADER => array(
'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',
'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber"
payload="{\r\n \"customer\":{\r\n \"email\": \"[email protected]\",\r\n \"identification\": \"12123123\",\r\n \"name\": \"Test Mobbex\"\r\n },\r\n \"startDate\":{\r\n \"day\": 27,\r\n \"month\": 3,\r\n \"year\": 2021\r\n },\r\n \"reference\": \"233211212\"\r\n}"
headers = {
'x-api-key': 'zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',
'x-access-token': 'd31f0721-2f85-44e7-bcc6-15e19d1a53cc',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
{
"result": true,
"data": {
"uid": "Y7B3P541B9VFBYTHSZ",
"reference": "233211212",
"sourceUrl": "https://mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber/Y7B3P541B9VFBYTHSZ/source",
"subscriberUrl": "https://mobbex.com/p/subscriptions/T691POMK62SGC7CHAK/subscriber/Y7B3P541B9VFBYTHSZ",
"subscription": {
"uid": "T691POMK62SGC7CHAK"
}
}
}Ejemplo Cambio de método de pago via Wallet
POST https://api.mobbex.com/p/subscriptions/H4QAGHOPE9QW6CUKVO/subscriber/5H1LBRT4WNGYFX3PUF/source
{
"token": "W:T3J9TBMJFLVKU846WE",
"securityCode": "200"
}Respuesta
{
"result": true,
"data": {
"status": "success",
"code": "200",
"text": "Operación Exitosa!",
"operation": {
"view": "default",
"options": {},
"id": "3EQRSGW7OJXHJDGADHN631",
"status": {
"code": "200",
"text": "Aprobado",
"message": "Transacción Aprobada",
"data": {},
"view": "default"
},
"total": 30.78,
"currency": {
"value": "TEST",
"label": "Test Money",
"symbol": "T$",
"locale": "es",
"isoCode": "000",
"exponent": 2,
"hidden": false
},
"data": [],
"actions": []
}
}
}