Pular para o conteúdo

Criar um pagamento

POST
/payments

Cria uma nova tentativa de pagamento. O tipo de pagamento e o custo líquido devem ser fornecidos. Dependendo do método de pagamento, a resposta pode incluir uma URL de redirecionamento que o usuário deve abrir no navegador para concluir o pagamento.

The payment request payload

Media type application/json

Payment creation request payload

object
net_val
required

Valor líquido do pagamento (valor real, ex. 50.00 para 50.00 EUR). O total incluindo taxas e IVA é calculado automaticamente.

number
type
required

Tipo de pagamento: “sepa” = débito direto SEPA, “stored_card” = cartão salvo

string
Allowed values: sepa stored_card
method_id
required

ID do método de pagamento de GET /payment_methods (ID do cartão salvo ou 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

Currency

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
}

Invalid input

Client ID or API key isn’t active or invalid!

There are not enough funds on your account!

Account isn’t activated. Please wait or contact to support!

The request was well-formed but was unable to be followed due to semantic errors

O endereço IP foi bloqueado temporariamente, pois durante um curto período de tempo foram enviadas várias solicitações com credenciais inválidas. Aguarde e tente mais 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