Ir al contenido

Crear un pago

POST
/payments

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.

The payment request payload

Media type application/json

Payment creation request payload

object
net_val
required

Importe neto del pago (valor real, ej. 50.00 para 50.00 EUR). El total incluyendo comisiones e IVA se calcula automáticamente.

number
type
required

Tipo de pago: “sepa” = débito directo SEPA, “stored_card” = tarjeta guardada

string
Allowed values: sepa stored_card
method_id
required

ID del método de pago de GET /payment_methods (ID de tarjeta guardada o mandato SEPA)

integer
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
}

Payment created

Payment attempt details (JSON-LD)

object
@id

JSON-LD ID

string
@type

JSON-LD type

string
@context
One of:
string
id

Payment Attempt ID

integer
created_at

Creation date (unix timestamp)

integer
completed_at

Completion date (unix timestamp), null if not completed

integer | null
status

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

integer
Allowed values: 0 10 20 100 200 300 400 1000
amount

Total payment amount

number
net_val

Net cost value

number
vat_val

VAT value

number
fee_val

Fee value

number
currency

Moneda

string
default: EUR
Allowed values: EUR CHF
type

Payment method: 1 = SEPA, 6 = Bank Transfer, 7 = PayPal, 8 = Sofort, 91 = Stored Card, 92 = New Card

integer
Allowed values: 1 6 7 8 91 92
invoice

URI to related invoice, null if not yet created

string | null
error

Error message if payment failed, null otherwise

string | null
Examples
Example bank_transfer

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}' | jq