# Payment

Provider API v0.6.5 · 2 operasjoner
Kilde: https://plas.redia.dk/no/provider/v0.6.5/payment/

Ingen beskrivelse i spesifikasjonen.

## Finalize Payment

`POST` `/patron/{patronId}/payment/finalize` · `FinalizePayment`

Finalize payment, mark fees as paid.

Multiple calls to finalize payment with the same payment ID will return the same confirmation ID, and the 
FinalizeFeeStatus will be 'registered' (provided, of course, that the previous call also resulted in status 'registered').

If in the configuration, payment->initialize->state is `use_initialize` and the initialize endpoint has not been called (e.g. if the order ID is not created), finalize returns the error code 300005.  
This also means that `orderId` is required in the request if payment->initialize->state is `use_initialize`. 

Multiple calls to finalize payment with the same payment ID will return the same confirmation ID for a minimum of 48 hours.  
If finalize is called a second time with the same payment ID, and any information in the request has changed, finalize returns the error code 300301.


### Parametere

- `patronId` (i `path`, `string`, påkrevd) — Patron ID from authentication

Felles for operasjonene: `version`. [Se den felles kontrakten på versjonssiden.](https://plas.redia.dk/no/provider/v0.6.5/)

### Request body

`application/json` · påkrevd

[`FinalizePaymentRequestBody`](https://plas.redia.dk/no/provider/v0.6.5/schemas/#FinalizePaymentRequestBody)

### Svar

- `200` [`FinalizeFeesResponseBody`](https://plas.redia.dk/no/provider/v0.6.5/schemas/#FinalizeFeesResponseBody) — Returns a response detailing how the finalize operation went for each fee ID.

Feilsvar: 400 · 401 · 404 — [Se den felles kontrakten på versjonssiden.](https://plas.redia.dk/no/provider/v0.6.5/)

## Initialize payment

`POST` `/patron/{patronId}/payment/initialize` · `InitializePayment`

This validates that the method can be used, initializes the payment, and returns an order ID.


### Parametere

- `patronId` (i `path`, `string`, påkrevd) — Patron ID from authentication

Felles for operasjonene: `version`. [Se den felles kontrakten på versjonssiden.](https://plas.redia.dk/no/provider/v0.6.5/)

### Request body

`application/json` · påkrevd

[`InitializePaymentRequestBody`](https://plas.redia.dk/no/provider/v0.6.5/schemas/#InitializePaymentRequestBody)

### Svar

- `200` [`InitializePaymentResponseBody`](https://plas.redia.dk/no/provider/v0.6.5/schemas/#InitializePaymentResponseBody) — Returns a order ID which can be used to finalize the payment.

Feilsvar: 400 · 401 · 404 — [Se den felles kontrakten på versjonssiden.](https://plas.redia.dk/no/provider/v0.6.5/)
