Link de Pago
8 min
Creación de la Orden de Pago
POST
https://api.mobbex.com/p/payment_order
Header Parameters
- x-api-keystringrequiredDescription
- x-access-tokenstringrequiredDescription
- Content-TypestringrequiredDescription
Body Parameters
- totalNumberrequiredDescription
- descriptionstringrequiredDescription
- emailstringDescription
- phonestringDescription
- referencestringDescription
- dueObjectDescription
- due.dayNumberrequiredDescription
- due.monthNumberrequiredDescription
- due.yearNumberrequiredDescription
- secondDueObjectDescription
- secondDue.daysNumberrequiredDescription
- secondDue.surchargeNumberrequiredDescription
- actionsArrayDescription
- return_urlStringDescription
- webhookstringDescription
- intentStringDescription
- itemsArrayDescription
- optionsObjectDescription
- options.smsMessagestringDescription
- options.themeObjectDescription
- sourcesArrayDescription
- installmentsArrayDescription
- customerFormstringDescription
- testBooleanDescription
- splitArrayDescription
- customerObjectDescription
- customer.emailstringrequiredDescription
- customer.identificationstringrequiredDescription
- customer.namestringrequiredDescription
- customer.phonestringDescription
- customer.{field}ObjectDescription
- multicardBooleanDescription
- typeStringDescription
curl
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.mobbex.com/p/payment_order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{ \n\t\"total\":100,\n\t\"description\":\"Some Description 3\",\n\t\"actions\": [{\n\t\t\"icon\": \"attachment\",\n\t\t\"title\": \"Factura\",\n\t\t\"url\": \"https://speryans.com/mifactura/123\"\n\t}],\n\t\"reference\": \"mi_referencia_123\"\n}",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"cache-control: no-cache",
"x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc",
"x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj",
"x-lang: es"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}javascript
var data = JSON.stringify({
total: 100,
description: "Some Description #3",
due: {
day: 18,
month: 4,
year: 2021
},
secondDue:{
days: 10,
surcharge: 30
},
actions: [
{
icon: "attachment",
title: "Factura",
url: "https://speryans.com/mifactura/123",
},
],
return_url: "https://mobbex.com/order123/return",
webhook: "https://mobbex.com/order123/webhook",
reference: "mi_referencia_123",
options:{
smsMessage: "Enviamos la orden generada para su pago"
}
});
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/payment_order");
xhr.setRequestHeader("x-api-key", "zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj");
xhr.setRequestHeader("x-access-token", "d31f0721-2f85-44e7-bcc6-15e19d1a53cc");
xhr.setRequestHeader("x-lang", "es");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.send(data);php
<?php
$request = new HttpRequest();
$request->setUrl('https://api.mobbex.com/p/payment_order');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Content-Type' => 'application/json',
'x-lang' => 'es',
'x-access-token' => 'd31f0721-2f85-44e7-bcc6-15e19d1a53cc',
'x-api-key' => 'zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj'
));
$request->setBody('{
"total": 100,
"description": "Some Description #3",
"due": {
"day": 18,
"month": 4,
"year": 2021
},
"secondDue":{
"days": 10,
"surcharge": 30
},
"actions": [
{
"icon": "attachment",
"title": "Factura",
"url": "https://speryans.com/mifactura/123",
},
],
"return_url": "https://mobbex.com/order123/return",
"webhook": "https://mobbex.com/order123/webhook",
"reference": "mi_referencia_123",
"options":{
"smsMessage": "Enviamos la orden generada para su pago"
}
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}python
import requests
data = json.dumps({
"total": 100,
"description": "Some Description #3",
"due": {
"day": 18,
"month": 4,
"year": 2021
},
"secondDue": {
"days": 10,
"surcharge": 30
},
"actions": [
{
"icon": "attachment",
"title": "Factura",
"url": "https://speryans.com/mifactura/123",
},
],
"return_url": "https://mobbex.com/order123/return",
"webhook": "https://mobbex.com/order123/webhook",
"reference": "mi_referencia_123",
"options": {
"smsMessage": "Enviamos la orden generada para su pago"
}
})
headers = {"x-api-key": "zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj",
"x-access-token": "d31f0721-2f85-44e7-bcc6-15e19d1a53cc",
"x-lang": "es",
"Content-Type": "application/json",
"cache-control": "no-cache"}
r = requests.post("https://api.mobbex.com/p/checkout",
data=data, headers=headers)
# Print json response
# r.json()shell
curl -X POST \
https://napi.mobbex.com/p/payment_order \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-H 'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc' \
-H 'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj' \
-H 'x-lang: es' \
-d '{
"total": 100,
"description": "Some Description #3",
"due": {
"day": 18,
"month": 4,
"year": 2021
},
"secondDue":{
"days": 10,
"surcharge": 30
},
"actions": [
{
"icon": "attachment",
"title": "Factura",
"url": "https://speryans.com/mifactura/123",
},
],
"return_url": "https://mobbex.com/order123/return",
"webhook": "https://mobbex.com/order123/webhook",
"reference": "mi_referencia_123",
"options":{
"smsMessage": "Enviamos la orden generada para su pago"
}
}'200
{
"result": true,
"data": {
"uid": "JlwOU4dzj",
"secondDueSurcharge": 0,
"sources": [],
"installments: [],
"reference": "mi_referencia_123",
"return_url": "",
"webhook": "",
"emailSubject: "",
"test": false,
"customerForm": "default",
"description": "Orden de Pago con 1 Vencimiento",
"email": "",
"currency": "ARS",
"creator": null,
"app": "5761a3dd8aad6c120042b287",
"phone": "",
"dueDate": "2019-12-25T00:00:00.000Z",
"secondDueDate": null,
"created": "2020-11-18T18:43:17.412Z",
"url": "http://mobbex.com/p/payment_order/XXXXXX",
"qr": "",
"total": 100,
}
}Ejemplos del nodo actions:
"actions": [
{
"icon": "document",
"title": "Factura",
"url": "https://mobbex.com/mifactura/123"
},
{
"icon": "attachment",
"title": "Factura 2",
"url": "https://mobbex.com/mifactura/1234"
}
]Ejemplos del nodo items:
{
"items": [
{
"image": "https://www.mobbex.com/wp-content/uploads/2019/03/web_logo.png",
"quantity": 2,
"description": "Mi Producto",
"total": 50
}
]
}Las imágenes deben soportar HTTPS, de lo contrario no serán mostradas.
Ejemplos del nodo sources:
{
"sources": ["visa", "mastercard"]
}Ejemplos del nodo installments:
Existen 3 formas de limitar los planes en base a su reference:
- Limitar los Planes únicamente a los elegidas en el Array:
{
"installments": ["1", "3", "ahora_12"]
}- Ocultar determinados planes de todo el conjunto de planes existentes:
{
"installments": ["-ahora_12", "-ahora_18"]
}- Mostrar planes especiales basado en Reglas Avanzadas:
{
"installments": ["+uid:kCbnpZB7B"]
}Para conocer las opciones disponibles de medios de pago sources y planes installments ver Métodos de pago y cuotas
Para el caso especial de los Planes Ahora ( Argentina ) las referencias siempre serán fijas: ahora_3, ahora_6, ahora_12, ahora_18
Atributo "reference"
Este atributo es utilizado para evitar pagos duplicados. Debe ser único para cada operación de pago a identificar, ya que Mobbex NO permitirá 2 transacciones en estado "Pago" con el mismo reference.
Reenviar Orden de Pago
Esta API permite reenviar la orden de pago a través de email o teléfono definido en la misma
POST
https://api.mobbex.com/p/payment_order/resend
Header Parameters
- x-api-keystringrequiredDescription
- x-access-tokenstringrequiredDescription
Body Parameters
- idstringrequiredDescription
javascript
var data = JSON.stringify({
id: "JlwOU4dzj"
});
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/payment_order/resend");
xhr.setRequestHeader("x-api-key", "zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj");
xhr.setRequestHeader("x-access-token", "d31f0721-2f85-44e7-bcc6-15e19d1a53cc");
xhr.setRequestHeader("x-lang", "es");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.send(data);200
{}Eliminar Orden de Pago
DELETE
https://api.mobbex.com/p/payment_order/{ID}
Query Parameters
- IDstringrequiredDescription
Header Parameters
- x-api-keystringrequiredDescription
- x-access-tokenstringrequiredDescription
javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.mobbex.com/p/payment_order/JlwOU4dzj");
xhr.setRequestHeader("x-api-key", "zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj");
xhr.setRequestHeader("x-access-token", "d31f0721-2f85-44e7-bcc6-15e19d1a53cc");
xhr.setRequestHeader("x-lang", "es");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.send();200
{
"result": true
}Marcar una Orden de Pago como Paga
POST
https://api.mobbex.com/p/payment_order/{ID}/paid
Path Parameters
- IDstringrequiredDescription
Header Parameters
- x-api-keystringrequiredDescription
- x-access-tokenstringrequiredDescription
curl
curl --location --request POST 'https://api.mobbex.com/p/payment_order/JlwOU4dzj/paid' \
--header 'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj' \
--header 'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'javascript
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/payment_order/JlwOU4dzj/paid");
xhr.setRequestHeader("x-api-key", "zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj");
xhr.setRequestHeader("x-access-token", "d31f0721-2f85-44e7-bcc6-15e19d1a53cc");
xhr.send();200
{
"result": true,
"view": {
"type": "none"
},
"payment": {
"id": "IGev250cR",
"description": "Orden de Pago con 1 Vencimiento",
"operation": {
"type": "manual"
},
"status": {
"code": "200",
"text": "Aprobado",
"message": ""
},
"total": 100,
"currency": {
"code": "ARS",
"text": "Peso Argentino",
"symbol": "$"
},
"riskAnalysis": {
"band": "N/A",
"level": "N/A"
},
"created": "2021-05-28T13:54:37.978Z",
"updated": "2021-05-28T13:54:37.986Z",
"reference": "mi_referencia_123"
},
"user": {
"name": "",
"email": ""
}
}404