Repository: VictorAvelar/mollie-api-go
Pull request #350 (2024-03-15 19:26:11)

check settlements resource against api reference
<!--- Provide a general summary of your changes in the Title above -->

# Description

Ensures that the `settlements` resource delivers API parity. 

## Motivation and context

Ensures the library has full API parity.

## How has this been tested?

Please describe in detail how you tested your changes.

Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc.

- [x] Unit tests added / updated
- [x] The tests run on docker (using `make test`)
- [ ] The required `test data` has been added / updated

If you are running the tests locally, please specify:

- OS: macos
- Go version 1.22

## Types of changes

What types of changes does your code introduce? Put an `x` in all the boxes that apply:

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] This change requires a documentation update

## Checklist

Go over all the following points, and put an `x` in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your [tests and code style pass](https://help.github.com/articles/about-required-status-checks/).

- [x] I have read the **[CONTRIBUTING](CONTRIBUTING.md)** document.
- [x] My pull request addresses exactly one patch/feature.
- [x] I have created a branch for this patch/feature.
- [x] Each individual commit in the pull request is meaningful.
- [x] If my change requires a change to the documentation, I have updated it accordingly.

<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->



Patch:
diff --git a/docs/README.md b/docs/README.md
index 493647b..fcc685d 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -161,6 +161,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
 - [type LinkedClientList](<#LinkedClientList>)
 - [type ListLinkedClientsOptions](<#ListLinkedClientsOptions>)
 - [type ListPaymentOptions](<#ListPaymentOptions>)
+- [type ListSettlementsOptions](<#ListSettlementsOptions>)
 - [type Locale](<#Locale>)
 - [type Mandate](<#Mandate>)
 - [type MandateDetails](<#MandateDetails>)
@@ -327,14 +328,13 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
 - [type SettlementRevenue](<#SettlementRevenue>)
 - [type SettlementStatus](<#SettlementStatus>)
 - [type SettlementsList](<#SettlementsList>)
-- [type SettlementsListOptions](<#SettlementsListOptions>)
 - [type SettlementsService](<#SettlementsService>)
-  - [func \(ss \*SettlementsService\) Get\(ctx context.Context, id string\) \(res \*Response, s \*Settlement, err error\)](<#SettlementsService.Get>)
-  - [func \(ss \*SettlementsService\) GetCaptures\(ctx context.Context, id string, slo \*SettlementsListOptions\) \(res \*Response, cl \*CapturesList, err error\)](<#SettlementsService.GetCaptures>)
-  - [func \(ss \*SettlementsService\) GetChargebacks\(ctx context.Context, id string, slo \*SettlementsListOptions\) \(res \*Response, cl \*ChargebacksList, err error\)](<#SettlementsService.GetChargebacks>)
-  - [func \(ss \*SettlementsService\) GetPayments\(ctx context.Context, id string, slo \*SettlementsListOptions\) \(res \*Response, pl \*PaymentList, err error\)](<#SettlementsService.GetPayments>)
-  - [func \(ss \*SettlementsService\) GetRefunds\(ctx context.Context, id string, slo \*SettlementsListOptions\) \(res \*Response, rl \*RefundsList, err error\)](<#SettlementsService.GetRefunds>)
-  - [func \(ss \*SettlementsService\) List\(ctx context.Context, slo \*SettlementsListOptions\) \(res \*Response, sl \*SettlementsList, err error\)](<#SettlementsService.List>)
+  - [func \(ss \*SettlementsService\) Get\(ctx context.Context, settlement string\) \(res \*Response, s \*Settlement, err error\)](<#SettlementsService.Get>)
+  - [func \(ss \*SettlementsService\) GetCaptures\(ctx context.Context, settlement string, slo \*ListSettlementsOptions\) \(res \*Response, cl \*CapturesList, err error\)](<#SettlementsService.GetCaptures>)
+  - [func \(ss \*SettlementsService\) GetChargebacks\(ctx context.Context, settlement string, slo \*ChargebacksListOptions\) \(res \*Response, cl \*ChargebacksList, err error\)](<#SettlementsService.GetChargebacks>)
+  - [func \(ss \*SettlementsService\) GetRefunds\(ctx context.Context, settlement string, slo \*ListSettlementsOptions\) \(res \*Response, rl \*RefundsList, err error\)](<#SettlementsService.GetRefunds>)
+  - [func \(ss \*SettlementsService\) List\(ctx context.Context, slo \*ListSettlementsOptions\) \(res \*Response, sl \*SettlementsList, err error\)](<#SettlementsService.List>)
+  - [func \(ss \*SettlementsService\) ListPayments\(ctx context.Context, settlement string, options \*ListPaymentOptions\) \(res \*Response, pl \*PaymentList, err error\)](<#SettlementsService.ListPayments>)
   - [func \(ss \*SettlementsService\) Next\(ctx context.Context\) \(res \*Response, s \*Settlement, err error\)](<#SettlementsService.Next>)
   - [func \(ss \*SettlementsService\) Open\(ctx context.Context\) \(res \*Response, s \*Settlement, err error\)](<#SettlementsService.Open>)
 - [type Shipment](<#Shipment>)
@@ -2749,6 +2749,19 @@ type ListPaymentOptions struct {
 }
 ```
 
+<a name="ListSettlementsOptions"></a>
+## type [ListSettlementsOptions](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L81-L85>)
+
+ListSettlementsOptions contains query parameters for settlement lists.
+
+```go
+type ListSettlementsOptions struct {
+    From  string       `url:"from,omitempty"`
+    Limit int          `url:"limit,omitempty"`
+    Embed []EmbedValue `url:"embed,omitempty"`
+}
+```
+
 <a name="Locale"></a>
 ## type [Locale](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/common_types.go#L89>)
 
@@ -4853,8 +4866,8 @@ Rate describes service rates, further divided into fixed and percentage costs.
 
 ```go
 type Rate struct {
-    Fixed    *Amount `json:"fixed,omitempty"`
     Variable string  `json:"variable,omitempty"`
+    Fixed    *Amount `json:"fixed,omitempty"`
 }
 ```
 
@@ -5104,44 +5117,45 @@ const (
 ```
 
 <a name="Settlement"></a>
-## type [Settlement](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L69-L80>)
+## type [Settlement](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L67-L78>)
 
 Settlement contains successful payments, together with refunds, captures and chargebacks into settlements.
 
 ```go
 type Settlement struct {
-    ID        string           `json:"id,omitempty"`
-    Resource  string           `json:"resource,omitempty"`
-    Reference string           `json:"reference,omitempty"`
-    CreatedAt *time.Time       `json:"createdAt,omitempty"`
-    SettledAt *time.Time       `json:"settledAt,omitempty"`
-    Status    SettlementStatus `json:"status,omitempty"`
-    Amount    *Amount          `json:"amount,omitempty"`
-    Periods   SettlementObject `json:"periods,omitempty"`
-    InvoiceID string           `json:"invoiceId,omitempty"`
-    Links     SettlementLinks  `json:"_links,omitempty"`
+    ID        string            `json:"id,omitempty"`
+    Resource  string            `json:"resource,omitempty"`
+    Reference string            `json:"reference,omitempty"`
+    InvoiceID string            `json:"invoiceId,omitempty"`
+    CreatedAt *time.Time        `json:"createdAt,omitempty"`
+    SettledAt *time.Time        `json:"settledAt,omitempty"`
+    Amount    *Amount           `json:"amount,omitempty"`
+    Periods   *SettlementObject `json:"periods,omitempty"`
+    Status    SettlementStatus  `json:"status,omitempty"`
+    Links     SettlementLinks   `json:"_links,omitempty"`
 }
 ```
 
 <a name="SettlementCosts"></a>
-## type [SettlementCosts](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L35-L43>)
+## type [SettlementCosts](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L32-L41>)
 
 SettlementCosts contains information about costs related to a settlement.
 
 ```go
 type SettlementCosts struct {
+    Count       int           `json:"count,omitempty"`
     Description string        `json:"description,omitempty"`
+    InvoiceID   string        `json:"invoiceId,omitempty"`
     AmountNet   *Amount       `json:"amountNet,omitempty"`
     AmountVAT   *Amount       `json:"amountVat,omitempty"`
     AmountGross *Amount       `json:"amountGross,omitempty"`
-    Count       int           `json:"count,omitempty"`
     Rate        *Rate         `json:"rate,omitempty"`
     Method      PaymentMethod `json:"method,omitempty"`
 }
 ```
 
 <a name="SettlementLinks"></a>
-## type [SettlementLinks](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L57-L65>)
+## type [SettlementLinks](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L55-L63>)
 
 SettlementLinks is an object with several URL objects relevant to the settlement.
 
@@ -5158,7 +5172,7 @@ type SettlementLinks struct {
 ```
 
 <a name="SettlementObject"></a>
-## type [SettlementObject](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L54>)
+## type [SettlementObject](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L52>)
 
 SettlementObject nests as describes for settlement periods.
 
@@ -5167,37 +5181,37 @@ type SettlementObject map[string]map[string]SettlementPeriod
 ```
 
 <a name="SettlementPeriod"></a>
-## type [SettlementPeriod](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L46-L51>)
+## type [SettlementPeriod](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L44-L49>)
 
 SettlementPeriod describe the settlement by month in full detail.
 
 ```go
 type SettlementPeriod struct {
-    Revenue          []*SettlementRevenue `json:"revenue,omitempty"`
-    Costs            []*SettlementCosts   `json:"costs,omitempty"`
     InvoiceID        string               `json:"invoiceId,omitempty"`
     InvoiceReference string               `json:"invoiceReference,omitempty"`
+    Revenue          []*SettlementRevenue `json:"revenue,omitempty"`
+    Costs            []*SettlementCosts   `json:"costs,omitempty"`
 }
 ```
 
 <a name="SettlementRevenue"></a>
-## type [SettlementRevenue](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L25-L32>)
+## type [SettlementRevenue](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L22-L29>)
 
 SettlementRevenue objects contain the total revenue for each payment method during this period.
 
 ```go
 type SettlementRevenue struct {
+    Count       int           `json:"count,omitempty"`
     Description string        `json:"description,omitempty"`
     AmountNet   *Amount       `json:"amountNet,omitempty"`
     AmountVAT   *Amount       `json:"amountVat,omitempty"`
     AmountGross *Amount       `json:"amountGross,omitempty"`
-    Count       int           `json:"count,omitempty"`
     Method      PaymentMethod `json:"method,omitempty"`
 }
 ```
 
 <a name="SettlementStatus"></a>
-## type [SettlementStatus](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L14>)
+## type [SettlementStatus](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L11>)
 
 SettlementStatus describes the status of the settlement.
 
@@ -5217,7 +5231,7 @@ const (
 ```
 
 <a name="SettlementsList"></a>
-## type [SettlementsList](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L90-L96>)
+## type [SettlementsList](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L88-L94>)
 
 SettlementsList describes a list of settlements.
 
@@ -5231,21 +5245,8 @@ type SettlementsList struct {
 }
 ```
 
-<a name="SettlementsListOptions"></a>
-## type [SettlementsListOptions](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L83-L87>)
-
-SettlementsListOptions contains query parameters for settlement lists.
-
-```go
-type SettlementsListOptions struct {
-    From  string     `url:"from,omitempty"`
-    Limit int        `url:"limit,omitempty"`
-    Embed EmbedValue `url:"embed,omitempty"`
-}
-```
-
 <a name="SettlementsService"></a>
-## type [SettlementsService](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L11>)
+## type [SettlementsService](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L97>)
 
 SettlementsService operates over settlements resource.
 
@@ -5254,10 +5255,10 @@ type SettlementsService service
 ```
 
 <a name="SettlementsService.Get"></a>
-### func \(\*SettlementsService\) [Get](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L101>)
+### func \(\*SettlementsService\) [Get](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L102>)
 
 ```go
-func (ss *SettlementsService) Get(ctx context.Context, id string) (res *Response, s *Settlement, err error)
+func (ss *SettlementsService) Get(ctx context.Context, settlement string) (res *Response, s *Settlement, err error)
 ```
 
 Get returns a settlement by its id or the bank reference id
@@ -5265,10 +5266,10 @@ Get returns a settlement by its id or the bank reference id
 See: https://docs.mollie.com/reference/v2/settlements-api/get-settlement
 
 <a name="SettlementsService.GetCaptures"></a>
-### func \(\*SettlementsService\) [GetCaptures](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L203-L207>)
+### func \(\*SettlementsService\) [GetCaptures](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L205-L209>)
 
 ```go
-func (ss *SettlementsService) GetCaptures(ctx context.Context, id string, slo *SettlementsListOptions) (res *Response, cl *CapturesList, err error)
+func (ss *SettlementsService) GetCaptures(ctx context.Context, settlement string, slo *ListSettlementsOptions) (res *Response, cl *CapturesList, err error)
 ```
 
 GetCaptures retrieves all captures included in a settlement.
@@ -5276,32 +5277,21 @@ GetCaptures retrieves all captures included in a settlement.
 See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-captures
 
 <a name="SettlementsService.GetChargebacks"></a>
-### func \(\*SettlementsService\) [GetChargebacks](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L183-L187>)
+### func \(\*SettlementsService\) [GetChargebacks](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L185-L189>)
 
 ```go
-func (ss *SettlementsService) GetChargebacks(ctx context.Context, id string, slo *SettlementsListOptions) (res *Response, cl *ChargebacksList, err error)
+func (ss *SettlementsService) GetChargebacks(ctx context.Context, settlement string, slo *ChargebacksListOptions) (res *Response, cl *ChargebacksList, err error)
 ```
 
 GetChargebacks retrieves all chargebacks included in a settlement.
 
 See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-chargebacks
 
-<a name="SettlementsService.GetPayments"></a>
-### func \(\*SettlementsService\) [GetPayments](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L143-L147>)
-
-```go
-func (ss *SettlementsService) GetPayments(ctx context.Context, id string, slo *SettlementsListOptions) (res *Response, pl *PaymentList, err error)
-```
-
-GetPayments retrieves all payments included in a settlement.
-
-See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-payments
-
 <a name="SettlementsService.GetRefunds"></a>
-### func \(\*SettlementsService\) [GetRefunds](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L163-L167>)
+### func \(\*SettlementsService\) [GetRefunds](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L165-L169>)
 
 ```go
-func (ss *SettlementsService) GetRefunds(ctx context.Context, id string, slo *SettlementsListOptions) (res *Response, rl *RefundsList, err error)
+func (ss *SettlementsService) GetRefunds(ctx context.Context, settlement string, slo *ListSettlementsOptions) (res *Response, rl *RefundsList, err error)
 ```
 
 GetRefunds retrieves all refunds included in a settlement.
@@ -5309,18 +5299,29 @@ GetRefunds retrieves all refunds included in a settlement.
 See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-refunds
 
 <a name="SettlementsService.List"></a>
-### func \(\*SettlementsService\) [List](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L123-L127>)
+### func \(\*SettlementsService\) [List](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L124-L128>)
 
 ```go
-func (ss *SettlementsService) List(ctx context.Context, slo *SettlementsListOptions) (res *Response, sl *SettlementsList, err error)
+func (ss *SettlementsService) List(ctx context.Context, slo *ListSettlementsOptions) (res *Response, sl *SettlementsList, err error)
 ```
 
 List retrieves all settlements, ordered from new to old
 
 See: https://docs.mollie.com/reference/v2/settlements-api/list-settlements
 
+<a name="SettlementsService.ListPayments"></a>
+### func \(\*SettlementsService\) [ListPayments](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L145-L149>)
+
+```go
+func (ss *SettlementsService) ListPayments(ctx context.Context, settlement string, options *ListPaymentOptions) (res *Response, pl *PaymentList, err error)
+```
+
+ListPayments retrieves all payments included in a settlement. This API is an alias of the List payments.
+
+See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-payments
+
 <a name="SettlementsService.Next"></a>
-### func \(\*SettlementsService\) [Next](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L108>)
+### func \(\*SettlementsService\) [Next](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L109>)
 
 ```go
 func (ss *SettlementsService) Next(ctx context.Context) (res *Response, s *Settlement, err error)
@@ -5331,7 +5332,7 @@ Next retrieves the details of the current settlement that has not yet been paid
 See: https://docs.mollie.com/reference/v2/settlements-api/get-next-settlement
 
 <a name="SettlementsService.Open"></a>
-### func \(\*SettlementsService\) [Open](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L116>)
+### func \(\*SettlementsService\) [Open](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/settlements.go#L117>)
 
 ```go
 func (ss *SettlementsService) Open(ctx context.Context) (res *Response, s *Settlement, err error)
diff --git a/mollie/common_types.go b/mollie/common_types.go
index 353df52..77e9956 100644
--- a/mollie/common_types.go
+++ b/mollie/common_types.go
@@ -348,8 +348,8 @@ const (
 
 // Rate describes service rates, further divided into fixed and percentage costs.
 type Rate struct {
-	Fixed    *Amount `json:"fixed,omitempty"`
 	Variable string  `json:"variable,omitempty"`
+	Fixed    *Amount `json:"fixed,omitempty"`
 }
 
 // Image describes a generic image resource retrieved by Mollie.
diff --git a/mollie/settlements.go b/mollie/settlements.go
index d2efda6..07fe184 100644
--- a/mollie/settlements.go
+++ b/mollie/settlements.go
@@ -7,9 +7,6 @@ import (
 	"time"
 )
 
-// SettlementsService operates over settlements resource.
-type SettlementsService service
-
 // SettlementStatus describes the status of the settlement.
 type SettlementStatus string
 
@@ -23,31 +20,32 @@ const (
 
 // SettlementRevenue objects contain the total revenue for each payment method during this period.
 type SettlementRevenue struct {
+	Count       int           `json:"count,omitempty"`
 	Description string        `json:"description,omitempty"`
 	AmountNet   *Amount       `json:"amountNet,omitempty"`
 	AmountVAT   *Amount       `json:"amountVat,omitempty"`
 	AmountGross *Amount       `json:"amountGross,omitempty"`
-	Count       int           `json:"count,omitempty"`
 	Method      PaymentMethod `json:"method,omitempty"`
 }
 
 // SettlementCosts contains information about costs related to a settlement.
 type SettlementCosts struct {
+	Count       int           `json:"count,omitempty"`
 	Description string        `json:"description,omitempty"`
+	InvoiceID   string        `json:"invoiceId,omitempty"`
 	AmountNet   *Amount       `json:"amountNet,omitempty"`
 	AmountVAT   *Amount       `json:"amountVat,omitempty"`
 	AmountGross *Amount       `json:"amountGross,omitempty"`
-	Count       int           `json:"count,omitempty"`
 	Rate        *Rate         `json:"rate,omitempty"`
 	Method      PaymentMethod `json:"method,omitempty"`
 }
 
 // SettlementPeriod describe the settlement by month in full detail.
 type SettlementPeriod struct {
-	Revenue          []*SettlementRevenue `json:"revenue,omitempty"`
-	Costs            []*SettlementCosts   `json:"costs,omitempty"`
 	InvoiceID        string               `json:"invoiceId,omitempty"`
 	InvoiceReference string               `json:"invoiceReference,omitempty"`
+	Revenue          []*SettlementRevenue `json:"revenue,omitempty"`
+	Costs            []*SettlementCosts   `json:"costs,omitempty"`
 }
 
 // SettlementObject nests as describes for settlement periods.
@@ -67,23 +65,23 @@ type SettlementLinks struct {
 // Settlement contains successful payments, together with refunds,
 // captures and chargebacks into settlements.
 type Settlement struct {
-	ID        string           `json:"id,omitempty"`
-	Resource  string           `json:"resource,omitempty"`
-	Reference string           `json:"reference,omitempty"`
-	CreatedAt *time.Time       `json:"createdAt,omitempty"`
-	SettledAt *time.Time       `json:"settledAt,omitempty"`
-	Status    SettlementStatus `json:"status,omitempty"`
-	Amount    *Amount          `json:"amount,omitempty"`
-	Periods   SettlementObject `json:"periods,omitempty"`
-	InvoiceID string           `json:"invoiceId,omitempty"`
-	Links     SettlementLinks  `json:"_links,omitempty"`
+	ID        string            `json:"id,omitempty"`
+	Resource  string            `json:"resource,omitempty"`
+	Reference string            `json:"reference,omitempty"`
+	InvoiceID string            `json:"invoiceId,omitempty"`
+	CreatedAt *time.Time        `json:"createdAt,omitempty"`
+	SettledAt *time.Time        `json:"settledAt,omitempty"`
+	Amount    *Amount           `json:"amount,omitempty"`
+	Periods   *SettlementObject `json:"periods,omitempty"`
+	Status    SettlementStatus  `json:"status,omitempty"`
+	Links     SettlementLinks   `json:"_links,omitempty"`
 }
 
-// SettlementsListOptions contains query parameters for settlement lists.
-type SettlementsListOptions struct {
-	From  string     `url:"from,omitempty"`
-	Limit int        `url:"limit,omitempty"`
-	Embed EmbedValue `url:"embed,omitempty"`
+// ListSettlementsOptions contains query parameters for settlement lists.
+type ListSettlementsOptions struct {
+	From  string       `url:"from,omitempty"`
+	Limit int          `url:"limit,omitempty"`
+	Embed []EmbedValue `url:"embed,omitempty"`
 }
 
 // SettlementsList describes a list of settlements.
@@ -95,11 +93,14 @@ type SettlementsList struct {
 	Links PaginationLinks `json:"_links,omitempty"`
 }
 
+// SettlementsService operates over settlements resource.
+type SettlementsService service
+
 // Get returns a settlement by its id or the bank reference id
 //
 // See: https://docs.mollie.com/reference/v2/settlements-api/get-settlement
-func (ss *SettlementsService) Get(ctx context.Context, id string) (res *Response, s *Settlement, err error) {
-	return ss.get(ctx, id)
+func (ss *SettlementsService) Get(ctx context.Context, settlement string) (res *Response, s *Settlement, err error) {
+	return ss.get(ctx, settlement)
 }
 
 // Next retrieves the details of the current settlement that has not yet been paid out.
@@ -120,7 +121,7 @@ func (ss *SettlementsService) Open(ctx context.Context) (res *Response, s *Settl
 // List retrieves all settlements, ordered from new to old
 //
 // See: https://docs.mollie.com/reference/v2/settlements-api/list-settlements
-func (ss *SettlementsService) List(ctx context.Context, slo *SettlementsListOptions) (
+func (ss *SettlementsService) List(ctx context.Context, slo *ListSettlementsOptions) (
 	res *Response,
 	sl *SettlementsList,
 	err error,
@@ -137,15 +138,16 @@ func (ss *SettlementsService) List(ctx context.Context, slo *SettlementsListOpti
 	return
 }
 
-// GetPayments retrieves all payments included in a settlement.
+// ListPayments retrieves all payments included in a settlement.
+// This API is an alias of the List payments.
 //
 // See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-payments
-func (ss *SettlementsService) GetPayments(ctx context.Context, id string, slo *SettlementsListOptions) (
+func (ss *SettlementsService) ListPayments(ctx context.Context, settlement string, options *ListPaymentOptions) (
 	res *Response,
 	pl *PaymentList,
 	err error,
 ) {
-	res, err = ss.list(ctx, id, "payments", slo)
+	res, err = ss.list(ctx, settlement, "payments", options)
 	if err != nil {
 		return
 	}
@@ -160,12 +162,12 @@ func (ss *SettlementsService) GetPayments(ctx context.Context, id string, slo *S
 // GetRefunds retrieves all refunds included in a settlement.
 //
 // See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-refunds
-func (ss *SettlementsService) GetRefunds(ctx context.Context, id string, slo *SettlementsListOptions) (
+func (ss *SettlementsService) GetRefunds(ctx context.Context, settlement string, slo *ListSettlementsOptions) (
 	res *Response,
 	rl *RefundsList,
 	err error,
 ) {
-	res, err = ss.list(ctx, id, "refunds", slo)
+	res, err = ss.list(ctx, settlement, "refunds", slo)
 	if err != nil {
 		return
 	}
@@ -180,12 +182,12 @@ func (ss *SettlementsService) GetRefunds(ctx context.Context, id string, slo *Se
 // GetChargebacks retrieves all chargebacks included in a settlement.
 //
 // See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-chargebacks
-func (ss *SettlementsService) GetChargebacks(ctx context.Context, id string, slo *SettlementsListOptions) (
+func (ss *SettlementsService) GetChargebacks(ctx context.Context, settlement string, slo *ChargebacksListOptions) (
 	res *Response,
 	cl *ChargebacksList,
 	err error,
 ) {
-	res, err = ss.list(ctx, id, "chargebacks", slo)
+	res, err = ss.list(ctx, settlement, "chargebacks", slo)
 	if err != nil {
 		return
 	}
@@ -200,12 +202,12 @@ func (ss *SettlementsService) GetChargebacks(ctx context.Context, id string, slo
 // GetCaptures retrieves all captures included in a settlement.
 //
 // See: https://docs.mollie.com/reference/v2/settlements-api/list-settlement-captures
-func (ss *SettlementsService) GetCaptures(ctx context.Context, id string, slo *SettlementsListOptions) (
+func (ss *SettlementsService) GetCaptures(ctx context.Context, settlement string, slo *ListSettlementsOptions) (
 	res *Response,
 	cl *CapturesList,
 	err error,
 ) {
-	res, err = ss.list(ctx, id, "captures", slo)
+	res, err = ss.list(ctx, settlement, "captures", slo)
 	if err != nil {
 		return
 	}
@@ -230,14 +232,14 @@ func (ss *SettlementsService) get(ctx context.Context, element string) (res *Res
 	return
 }
 
-func (ss *SettlementsService) list(ctx context.Context, id string, category string, opts *SettlementsListOptions) (
+func (ss *SettlementsService) list(ctx context.Context, settlement string, category string, opts any) (
 	res *Response,
 	err error,
 ) {
 	uri := "v2/settlements"
 
-	if id != "" {
-		uri = fmt.Sprintf("%s/%s", uri, id)
+	if settlement != "" {
+		uri = fmt.Sprintf("%s/%s", uri, settlement)
 
 		if category != "" {
 			uri = fmt.Sprintf("%s/%s", uri, category)


Test patch:
diff --git a/mollie/settlements_test.go b/mollie/settlements_test.go
index 21dbb43..5f4fada 100644
--- a/mollie/settlements_test.go
+++ b/mollie/settlements_test.go
@@ -289,7 +289,7 @@ func TestSettlementsService_List(t *testing.T) {
 
 	type args struct {
 		ctx     context.Context
-		options *SettlementsListOptions
+		options *ListSettlementsOptions
 	}
 	cases := []struct {
 		name    string
@@ -303,7 +303,7 @@ func TestSettlementsService_List(t *testing.T) {
 			"list shipment works as expected.",
 			args{
 				context.Background(),
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 40,
 				},
 			},
@@ -325,7 +325,7 @@ func TestSettlementsService_List(t *testing.T) {
 			"list shipment, an error is returned from the server",
 			args{
 				context.Background(),
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 40,
 				},
 			},
@@ -338,7 +338,7 @@ func TestSettlementsService_List(t *testing.T) {
 			"list shipment, an error occurs when parsing json",
 			args{
 				context.Background(),
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 40,
 				},
 			},
@@ -351,7 +351,7 @@ func TestSettlementsService_List(t *testing.T) {
 			"list shipment, invalid url when building request",
 			args{
 				context.Background(),
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 40,
 				},
 			},
@@ -390,7 +390,7 @@ func TestSettlementsService_GetPayments(t *testing.T) {
 	type args struct {
 		ctx        context.Context
 		settlement string
-		options    *SettlementsListOptions
+		options    *ListPaymentOptions
 	}
 	cases := []struct {
 		name    string
@@ -405,7 +405,7 @@ func TestSettlementsService_GetPayments(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListPaymentOptions{
 					Limit: 10,
 				},
 			},
@@ -428,7 +428,7 @@ func TestSettlementsService_GetPayments(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListPaymentOptions{
 					Limit: 10,
 				},
 			},
@@ -442,7 +442,7 @@ func TestSettlementsService_GetPayments(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListPaymentOptions{
 					Limit: 10,
 				},
 			},
@@ -456,7 +456,7 @@ func TestSettlementsService_GetPayments(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListPaymentOptions{
 					Limit: 10,
 				},
 			},
@@ -475,7 +475,7 @@ func TestSettlementsService_GetPayments(t *testing.T) {
 			c.pre()
 			tMux.HandleFunc(fmt.Sprintf("/v2/settlements/%s/payments", c.args.settlement), c.handler)
 
-			res, m, err := tClient.Settlements.GetPayments(c.args.ctx, c.args.settlement, c.args.options)
+			res, m, err := tClient.Settlements.ListPayments(c.args.ctx, c.args.settlement, c.args.options)
 			if c.wantErr {
 				assert.NotNil(t, err)
 				assert.EqualError(t, err, c.err.Error())
@@ -495,7 +495,7 @@ func TestSettlementsService_GetCaptures(t *testing.T) {
 	type args struct {
 		ctx        context.Context
 		settlement string
-		options    *SettlementsListOptions
+		options    *ListSettlementsOptions
 	}
 	cases := []struct {
 		name    string
@@ -510,7 +510,7 @@ func TestSettlementsService_GetCaptures(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 10,
 				},
 			},
@@ -533,7 +533,7 @@ func TestSettlementsService_GetCaptures(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 10,
 				},
 			},
@@ -547,7 +547,7 @@ func TestSettlementsService_GetCaptures(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 10,
 				},
 			},
@@ -561,7 +561,7 @@ func TestSettlementsService_GetCaptures(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 10,
 				},
 			},
@@ -600,7 +600,7 @@ func TestSettlementsService_GetChargebacks(t *testing.T) {
 	type args struct {
 		ctx        context.Context
 		settlement string
-		options    *SettlementsListOptions
+		options    *ChargebacksListOptions
 	}
 	cases := []struct {
 		name    string
@@ -615,7 +615,7 @@ func TestSettlementsService_GetChargebacks(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ChargebacksListOptions{
 					Limit: 10,
 				},
 			},
@@ -638,7 +638,7 @@ func TestSettlementsService_GetChargebacks(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ChargebacksListOptions{
 					Limit: 10,
 				},
 			},
@@ -652,7 +652,7 @@ func TestSettlementsService_GetChargebacks(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ChargebacksListOptions{
 					Limit: 10,
 				},
 			},
@@ -666,7 +666,7 @@ func TestSettlementsService_GetChargebacks(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ChargebacksListOptions{
 					Limit: 10,
 				},
 			},
@@ -705,7 +705,7 @@ func TestSettlementsService_GetRefunds(t *testing.T) {
 	type args struct {
 		ctx        context.Context
 		settlement string
-		options    *SettlementsListOptions
+		options    *ListSettlementsOptions
 	}
 	cases := []struct {
 		name    string
@@ -720,7 +720,7 @@ func TestSettlementsService_GetRefunds(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 10,
 				},
 			},
@@ -743,7 +743,7 @@ func TestSettlementsService_GetRefunds(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 10,
 				},
 			},
@@ -757,7 +757,7 @@ func TestSettlementsService_GetRefunds(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 10,
 				},
 			},
@@ -771,7 +771,7 @@ func TestSettlementsService_GetRefunds(t *testing.T) {
 			args{
 				context.Background(),
 				"stl_jDk30akdN",
-				&SettlementsListOptions{
+				&ListSettlementsOptions{
 					Limit: 10,
 				},
 			},