Closed MarcoWel closed 1 year ago
I can add the field but wanted to ask first, would you like to open a PR yourself?
Done! When there is no invoice for a settlement yet, there is no InvoiceID field neither in (Settlement.InvoiceID nor in SettlementPeriod.InvoiceID).
In this case however, there is another (undocumented) SettlementPeriod.InvoiceReference field holding an invoice reference, so I added this field as well.
"invoiceReference": "MOL-NL-R2023.0000123456"
Documentation: With the new Settlement.InvoiceID field, the proper way to get all invoice IDs for a settlement is:
invIds := []string{}
for _, yr := range settlement.Periods {
for _, m := range yr {
if m.InvoiceID != "" {
invIds = append(invIds, m.InvoiceID)
}
}
}
invoiceID := strings.Join(invIds, "/")
Before, Settlement.InvoiceID only held the oldest invoice ID.
Is your feature request related to a problem? Please describe. Settlement.InvoiceID has been deprecated and has now been moved to SettlementPeriod. This is not yet reflected by the go client.
Describe the solution you'd like Add
InvoiceID string
field totype SettlementPeriod
.Additional context https://docs.mollie.com/reference/v2/settlements-api/get-settlement