Przejdź do głównej zawartości

Utwórz płatność

POST
/payments

Tworzy nową próbę płatności. Należy podać typ płatności i koszt netto. W zależności od metody płatności odpowiedź może zawierać adres URL przekierowania, który użytkownik musi otworzyć w przeglądarce, aby dokończyć płatność.

The payment request payload

Media type application/json

Payment creation request payload

object
net_val
required

Kwota netto płatności (wartość rzeczywista, np. 50.00 dla 50.00 EUR). Łączna kwota wraz z opłatami i VAT jest obliczana automatycznie.

number
type
required

Typ płatności: “sepa” = polecenie zapłaty SEPA, “stored_card” = zapisana karta kredytowa/debetowa

string
Allowed values: sepa stored_card
method_id
required

Identyfikator metody płatności z GET /payment_methods (identyfikator zapisanej karty lub mandatu 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

Identyfikator JSON-LD

string
@type

Typ JSON-LD

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

Waluta

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
}

Nieprawidłowe dane wejściowe

Identyfikator klienta lub klucz API nie jest aktywny albo jest nieprawidłowy!

Na Twoim koncie brakuje wystarczających środków!

Konto nie jest aktywowane. Poczekaj lub skontaktuj się z pomocą techniczną!

Żądanie było poprawnie sformułowane, ale nie można go zrealizować z powodu błędów semantycznych

Adres IP został tymczasowo zablokowany, ponieważ w krótkim czasie wysłano z niego wiele żądań z nieprawidłowymi danymi uwierzytelniającymi. Poczekaj i spróbuj ponownie później.

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