Crear un pago
Crea un nuevo intento de pago. Se debe proporcionar el tipo de pago y el coste neto. Dependiendo del método de pago, la respuesta puede incluir una URL de redirección que el usuario debe abrir en un navegador para completar el pago.
Authorizations
Sección titulada «Authorizations »Request Body required
Sección titulada «Request Body required »The payment request payload
Payment creation request payload
object
Importe neto del pago (valor real, ej. 50.00 para 50.00 EUR). El total incluyendo comisiones e IVA se calcula automáticamente.
Tipo de pago: “sepa” = débito directo SEPA, “stored_card” = tarjeta guardada
ID del método de pago de GET /payment_methods (ID de tarjeta guardada o mandato SEPA)
Examples
Stored card payment
Example request for creating a payment with a previously saved credit/debit card
{ "net_val": 100, "type": "stored_card", "method_id": 94}SEPA direct debit payment
Example request for creating a payment via SEPA direct debit using an existing mandate
{ "net_val": 50, "type": "sepa", "method_id": 747}Responses
Sección titulada « Responses »Payment created
Payment attempt details (JSON-LD)
object
JSON-LD ID
JSON-LD type
Payment Attempt ID
Creation date (unix timestamp)
Completion date (unix timestamp), null if not completed
Payment status: 0 = New, 10 = In Progress (before request), 20 = In Progress (after request), 100 = Done, 200 = Canceled by user, 300 = Canceled by timeout, 400 = Canceled by admin, 1000 = Error
Total payment amount
Net cost value
VAT value
Fee value
Moneda
Payment method: 1 = SEPA, 6 = Bank Transfer, 7 = PayPal, 8 = Sofort, 91 = Stored Card, 92 = New Card
URI to related invoice, null if not yet created
Error message if payment failed, null otherwise
Examples
Bank transfer payment created
Example response for a bank transfer payment (no redirect, invoice created immediately)
{ "id": 120, "created_at": 1750066200, "completed_at": 1750066200, "status": 100, "amount": 100, "net_val": 100, "vat_val": 0, "fee_val": 0, "currency": "EUR", "type": 6, "invoice": "/invoices/456", "error": null}Payment attempt details
object
ID del intento de pago
Fecha de creación (timestamp Unix)
Fecha de finalización (timestamp Unix), null si no completado
Estado del pago: 0 = Nuevo, 10 = En progreso (antes de la solicitud), 20 = En progreso (después de la solicitud), 100 = Completado, 200 = Cancelado por el usuario, 300 = Cancelado por tiempo de espera, 400 = Cancelado por el administrador, 1000 = Error
Importe total del pago
Valor del coste neto
Valor del IVA
Valor de la comisión
Código de moneda
Método de pago: 1 = SEPA, 6 = Transferencia, 7 = PayPal, 8 = Sofort, 91 = Tarjeta guardada, 92 = Nueva tarjeta
URI a la factura relacionada, null si aún no se ha creado
Mensaje de error si el pago falló, null en caso contrario
ID del método de pago utilizado (ID de tarjeta guardada o mandato SEPA), null si no aplica
Examples
Bank transfer payment created
Example response for a bank transfer payment (no redirect, invoice created immediately)
{ "id": 120, "created_at": 1750066200, "completed_at": 1750066200, "status": 100, "amount": 100, "net_val": 100, "vat_val": 0, "fee_val": 0, "currency": "EUR", "type": 6, "invoice": "/invoices/456", "error": null}Entrada no valida
El ID de cliente o la clave API no están activos o no son válidos.
No hay fondos suficientes en su cuenta.
La cuenta no está activada. Espere o póngase en contacto con el servicio de asistencia.
La solicitud estaba bien formada pero no se pudo procesar debido a errores semánticos
La dirección IP fue bloqueada temporalmente, ya que durante poco tiempo se enviaron muchas solicitudes con credenciales no válidas. Espere y pruebe más tarde.
Code Samples
curl -s -X POST 'https://api.lox24.eu/payments' \ -H 'X-LOX24-AUTH-TOKEN: YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"net_val": 100.00, "type": "stored_card", "method_id": 94}' | jqusing System;using System.Net.Http;using System.Text;using System.Threading.Tasks;
class Program{ static async Task Main() { using var client = new HttpClient(); client.DefaultRequestHeaders.Add("X-LOX24-AUTH-TOKEN", "YOUR_API_TOKEN");
var content = new StringContent( "{\"net_val\": 100.00, \"type\": \"stored_card\", \"method_id\": 94}", Encoding.UTF8, "application/json" );
var response = await client.PostAsync("https://api.lox24.eu/payments", content); var result = await response.Content.ReadAsStringAsync(); Console.WriteLine(result); }}package main
import ( "fmt" "io" "net/http" "strings")
func main() { body := `{"net_val": 100.00, "type": "stored_card", "method_id": 94}` req, _ := http.NewRequest("POST", "https://api.lox24.eu/payments", strings.NewReader(body)) req.Header.Set("X-LOX24-AUTH-TOKEN", "YOUR_API_TOKEN") req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() respBody, _ := io.ReadAll(resp.Body) fmt.Println(string(respBody))}import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;
public class Main { public static void main(String[] args) throws Exception { var client = HttpClient.newHttpClient(); var body = "{\"net_val\": 100.00, \"type\": \"stored_card\", \"method_id\": 94}"; var request = HttpRequest.newBuilder() .uri(URI.create("https://api.lox24.eu/payments")) .header("X-LOX24-AUTH-TOKEN", "YOUR_API_TOKEN") .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(body)) .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); }}fetch('https://api.lox24.eu/payments', { method: 'POST', headers: { 'X-LOX24-AUTH-TOKEN': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify({ net_val: 100.00, type: 'stored_card', method_id: 94 })}).then(res => res.json()).then(console.log);<?php
$data = json_encode(['net_val' => 100.00, 'type' => 'stored_card', 'method_id' => 94]);
$ch = curl_init('https://api.lox24.eu/payments');curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'X-LOX24-AUTH-TOKEN: YOUR_API_TOKEN', 'Content-Type: application/json']);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_POSTFIELDS, $data);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);curl_close($ch);
echo $response;import requestsimport json
response = requests.post( 'https://api.lox24.eu/payments', headers={ 'X-LOX24-AUTH-TOKEN': 'YOUR_API_TOKEN', 'Content-Type': 'application/json' }, data=json.dumps({'net_val': 100.00, 'type': 'stored_card', 'method_id': 94}))print(response.json())