MÓDULOS
Suscripciones/Recurrencia
Suscripciones con wallet
8 min
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 wallet en "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" "demo\@mobbex com", "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 tab examples url https api mobbex com p wallet ref customerreference name obtener informaci n mediante customerreference con wallet method get request pathparameters queryparameters kind required name ref type string description referencia del suscriptor configurada en customerreference headerparameters kind required name x api key type string description clave api de su aplicaci n kind required name x access token type string description token de acceso a la entidad para la cual desea realizar la operaci n bodydataparameters formdataparameters results languages id xnrskh7 zvabt1qzc128m code n result true n data n uid y7b3p541b9vfbythsz n reference 233211212 n sourceurl https mobbex com p subscriptions t691pomk62sgc7chak subscriber y7b3p541b9vfbythsz source n subscriberurl https mobbex com p subscriptions t691pomk62sgc7chak subscriber y7b3p541b9vfbythsz n subscription n uid t691pomk62sgc7chak n n n language 200 selectedlanguageid xnrskh7 zvabt1qzc128m examples languages id pcaibxl7rd7t u9koj sc code var data json stringify n customer n email demo mobbex com n identification 12123123 n name test mobbex n n startdate n day 27 n month 3 n year 2021 n n reference 233211212 ; n nvar xhr new xmlhttprequest ; nxhr withcredentials true; n nxhr addeventlistener readystatechange function n if this readystate 4 n console log this responsetext ; n n ; n nxhr open post https api mobbex com p subscriptions t691pomk62sgc7chak subscriber ; nxhr setrequestheader x api key zj8lftbx6ba8d611e9io13fdzawj0qmko1hn1yij ; nxhr setrequestheader x access token d31f0721 2f85 44e7 bcc6 15e19d1a53cc ; nxhr setrequestheader content type application json ; n nxhr send data ; language javascript id e vrurb5gwpgf2s yoyaz code ?php r n r n curl curl init ; r n r ncurl setopt array curl array r n curlopt url https api mobbex com p subscriptions t691pomk62sgc7chak subscriber r n curlopt returntransfer true r n curlopt encoding r n curlopt maxredirs 10 r n curlopt timeout 0 r n curlopt followlocation true r n curlopt http version curl http version 1 1 r n curlopt customrequest post r n curlopt postfields r n customer r n email demo mobbex com 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 r n curlopt httpheader array r n x api key zj8lftbx6ba8d611e9io13fdzawj0qmko1hn1yij r n x access token d31f0721 2f85 44e7 bcc6 15e19d1a53cc r n content type application json r n r n ; r n r n response curl exec curl ; r n r ncurl close curl ; r necho response; r n language php id tftvkyk7epo7vkg7m0yfv code import requests r n r nurl https api mobbex com p subscriptions t691pomk62sgc7chak subscriber r n r npayload r n customer r n email demo mobbex com 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 r nheaders r n x api key zj8lftbx6ba8d611e9io13fdzawj0qmko1hn1yij r n x access token d31f0721 2f85 44e7 bcc6 15e19d1a53cc r n content type application json r n r n r nresponse requests request post url headers headers data payload r n r nprint response text r n language python selectedlanguageid pcaibxl7rd7t u9koj sc description permite obtener la informaci n de los suscriptores creados con sus tarjetas vinculadas wallet mediante la referencia customerreference currentnewparameter label body parameter value bodydataparameters 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" "demo\@mobbex com", "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 tab examples url https api mobbex com p subscriptions sid subscriber subid source name cambiar el m todo de pago a un suscriptor via wallet method post request pathparameters queryparameters kind required name sid type string description id de la suscripci n name subid kind required type string description id del suscriptor children headerparameters kind required name x api key type string description clave api de su aplicaci n kind required name x access token type string description token de acceso a la entidad para la cual desea realizar la operaci n bodydataparameters kind required name token type string children description id del token generado name securitycode kind required type string description c digo de seguridad de la tarjeta elegida children formdataparameters results languages id xnrskh7 zvabt1qzc128m code n result true n data n uid y7b3p541b9vfbythsz n reference 233211212 n sourceurl https mobbex com p subscriptions t691pomk62sgc7chak subscriber y7b3p541b9vfbythsz source n subscriberurl https mobbex com p subscriptions t691pomk62sgc7chak subscriber y7b3p541b9vfbythsz n subscription n uid t691pomk62sgc7chak n n n language 200 selectedlanguageid xnrskh7 zvabt1qzc128m examples languages id pcaibxl7rd7t u9koj sc code var data json stringify n customer n email demo mobbex com n identification 12123123 n name test mobbex n n startdate n day 27 n month 3 n year 2021 n n reference 233211212 ; n nvar xhr new xmlhttprequest ; nxhr withcredentials true; n nxhr addeventlistener readystatechange function n if this readystate 4 n console log this responsetext ; n n ; n nxhr open post https api mobbex com p subscriptions t691pomk62sgc7chak subscriber ; nxhr setrequestheader x api key zj8lftbx6ba8d611e9io13fdzawj0qmko1hn1yij ; nxhr setrequestheader x access token d31f0721 2f85 44e7 bcc6 15e19d1a53cc ; nxhr setrequestheader content type application json ; n nxhr send data ; language javascript id e vrurb5gwpgf2s yoyaz code ?php r n r n curl curl init ; r n r ncurl setopt array curl array r n curlopt url https api mobbex com p subscriptions t691pomk62sgc7chak subscriber r n curlopt returntransfer true r n curlopt encoding r n curlopt maxredirs 10 r n curlopt timeout 0 r n curlopt followlocation true r n curlopt http version curl http version 1 1 r n curlopt customrequest post r n curlopt postfields r n customer r n email demo mobbex com 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 r n curlopt httpheader array r n x api key zj8lftbx6ba8d611e9io13fdzawj0qmko1hn1yij r n x access token d31f0721 2f85 44e7 bcc6 15e19d1a53cc r n content type application json r n r n ; r n r n response curl exec curl ; r n r ncurl close curl ; r necho response; r n language php id tftvkyk7epo7vkg7m0yfv code import requests r n r nurl https api mobbex com p subscriptions t691pomk62sgc7chak subscriber r n r npayload r n customer r n email demo mobbex com 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 r nheaders r n x api key zj8lftbx6ba8d611e9io13fdzawj0qmko1hn1yij r n x access token d31f0721 2f85 44e7 bcc6 15e19d1a53cc r n content type application json r n r n r nresponse requests request post url headers headers data payload r n r nprint response text r n language python selectedlanguageid pcaibxl7rd7t u9koj sc description permite cambiar el m todo de pago guardado mediante customerreference a un suscriptor currentnewparameter label query parameter value queryparameters 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" \[] } } }