- List - List settlements
- Get - Get settlement
- GetOpen - Get open settlement
- GetNext - Get next settlement
- ListPayments - List settlement payments
- ListCaptures - List settlement captures
- ListRefunds - List settlement refunds
- ListChargebacks - List settlement chargebacks
Retrieve a list of all your settlements.
The results are paginated.
package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.List(ctx, operations.ListSettlementsRequest{
From: client.Pointer("stl_jDk30akdN"),
Limit: client.Pointer[int64](50),
BalanceID: client.Pointer("bal_gVMhHKqSSRYJyPsuoPNFH"),
Year: client.Pointer("2025"),
Month: client.Pointer("1"),
Currencies: components.CurrenciesEur.ToPointer(),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListSettlementsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListSettlementsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 400, 404 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve a single settlement by its ID.
To lookup settlements by their bank reference, replace the ID in the URL by
a reference. For example: 1234567.2404.03.
A settlement represents a transfer of your balance funds to your external bank account.
Settlements will typically include a report that details what balance transactions have taken place between this settlement and the previous one.
For more accurate bookkeeping, refer to the balance report endpoint or the balance transactions endpoint.
package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.Get(ctx, "stl_5B8cwPMGnU", client.Pointer("123e4567-e89b-12d3-a456-426"))
if err != nil {
log.Fatal(err)
}
if res.EntitySettlement != nil {
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
settlementID |
string |
✔️ | Provide the ID of the related settlement. | stl_5B8cwPMGnU |
idempotencyKey |
*string |
➖ | A unique key to ensure idempotent requests. This key should be a UUID v4 string. | 123e4567-e89b-12d3-a456-426 |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetSettlementResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 404 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve the details of the open balance of the organization. This will return a settlement object representing your organization's balance.
For a complete reference of the settlement object, refer to the Get settlement endpoint documentation.
For more accurate bookkeeping, refer to the balance report endpoint or the balance transactions endpoint.
package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.GetOpen(ctx, client.Pointer("123e4567-e89b-12d3-a456-426"))
if err != nil {
log.Fatal(err)
}
if res.EntitySettlement != nil {
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
idempotencyKey |
*string |
➖ | A unique key to ensure idempotent requests. This key should be a UUID v4 string. | 123e4567-e89b-12d3-a456-426 |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetOpenSettlementResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve the details of the current settlement, that has not yet been paid out.
For a complete reference of the settlement object, refer to the Get settlement endpoint documentation.
For more accurate bookkeeping, refer to the balance report endpoint or the balance transactions endpoint.
package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.GetNext(ctx, client.Pointer("123e4567-e89b-12d3-a456-426"))
if err != nil {
log.Fatal(err)
}
if res.EntitySettlement != nil {
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
idempotencyKey |
*string |
➖ | A unique key to ensure idempotent requests. This key should be a UUID v4 string. | 123e4567-e89b-12d3-a456-426 |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetNextSettlementResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve all payments included in the given settlement.
The response is in the same format as the response of the List payments endpoint.
For capture-based payment methods such as Klarna, the payments are not listed here. Refer to the List captures endpoint endpoint instead.
package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithProfileID("pfl_5B8cwPMGnU"),
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListPayments(ctx, operations.ListSettlementPaymentsRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("tr_5B8cwPMGnU"),
Limit: client.Pointer[int64](50),
Sort: components.SortingDesc.ToPointer(),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithProfileID("pfl_5B8cwPMGnU"),
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListPayments(ctx, operations.ListSettlementPaymentsRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("tr_5B8cwPMGnU"),
Limit: client.Pointer[int64](50),
Sort: components.SortingDesc.ToPointer(),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithProfileID("pfl_5B8cwPMGnU"),
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListPayments(ctx, operations.ListSettlementPaymentsRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("tr_5B8cwPMGnU"),
Limit: client.Pointer[int64](50),
Sort: components.SortingDesc.ToPointer(),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithProfileID("pfl_5B8cwPMGnU"),
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListPayments(ctx, operations.ListSettlementPaymentsRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("tr_5B8cwPMGnU"),
Limit: client.Pointer[int64](50),
Sort: components.SortingDesc.ToPointer(),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListSettlementPaymentsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListSettlementPaymentsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 400 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve all captures included in the given settlement.
The response is in the same format as the response of the List captures endpoint.
package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListCaptures(ctx, operations.ListSettlementCapturesRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("cpt_vytxeTZskVKR7C7WgdSP3d"),
Limit: client.Pointer[int64](50),
Embed: client.Pointer("payment"),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListCaptures(ctx, operations.ListSettlementCapturesRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("cpt_vytxeTZskVKR7C7WgdSP3d"),
Limit: client.Pointer[int64](50),
Embed: client.Pointer("payment"),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListCaptures(ctx, operations.ListSettlementCapturesRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("cpt_vytxeTZskVKR7C7WgdSP3d"),
Limit: client.Pointer[int64](50),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListSettlementCapturesRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListSettlementCapturesResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 400, 404 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve all refunds 'deducted' from the given settlement.
The response is in the same format as the response of the List refunds endpoint.
package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListRefunds(ctx, operations.ListSettlementRefundsRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("re_5B8cwPMGnU"),
Limit: client.Pointer[int64](50),
Embed: client.Pointer("payment"),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListRefunds(ctx, operations.ListSettlementRefundsRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("re_5B8cwPMGnU"),
Limit: client.Pointer[int64](50),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListSettlementRefundsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListSettlementRefundsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 400, 404 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve all chargebacks 'deducted' from the given settlement.
The response is in the same format as the response of the List chargebacks endpoint.
package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithTestmode(false),
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListChargebacks(ctx, operations.ListSettlementChargebacksRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("chb_xFzwUN4ci8HAmSGUACS4J"),
Limit: client.Pointer[int64](50),
Embed: client.Pointer("payment"),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithTestmode(false),
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListChargebacks(ctx, operations.ListSettlementChargebacksRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("chb_xFzwUN4ci8HAmSGUACS4J"),
Limit: client.Pointer[int64](50),
Embed: client.Pointer("payment"),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}package main
import(
"context"
"os"
"github.com/mollie/mollie-api-golang/models/components"
client "github.com/mollie/mollie-api-golang"
"github.com/mollie/mollie-api-golang/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := client.New(
client.WithTestmode(false),
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Settlements.ListChargebacks(ctx, operations.ListSettlementChargebacksRequest{
SettlementID: "stl_5B8cwPMGnU",
From: client.Pointer("chb_xFzwUN4ci8HAmSGUACS4J"),
Limit: client.Pointer[int64](50),
Embed: client.Pointer("payment"),
IdempotencyKey: client.Pointer("123e4567-e89b-12d3-a456-426"),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListSettlementChargebacksRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListSettlementChargebacksResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 400, 404 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |