- Create - Create profile
- List - List profiles
- Get - Get profile
- Update - Update profile
- Delete - Delete profile
- GetCurrent - Get current profile
Create a profile to process payments on.
Profiles are required for payment processing. Normally they are created via the Mollie dashboard. Alternatively, you can use this endpoint to automate profile creation.
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.Profiles.Create(ctx, components.ProfileRequest{
Name: "My website name",
Website: "https://example.com",
Email: "test@mollie.com",
Phone: "+31208202070",
Description: client.Pointer("My website description"),
CountriesOfActivity: []string{
"NL",
"GB",
},
BusinessCategory: client.Pointer("OTHER_MERCHANDISE"),
}, client.Pointer("123e4567-e89b-12d3-a456-426"))
if err != nil {
log.Fatal(err)
}
if res.ProfileResponse != nil {
// handle response
}
}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.Profiles.Create(ctx, components.ProfileRequest{
Name: "My website name",
Website: "https://example.com",
Email: "test@mollie.com",
Phone: "+31208202070",
Description: client.Pointer("My website description"),
CountriesOfActivity: []string{
"NL",
"GB",
},
BusinessCategory: client.Pointer("OTHER_MERCHANDISE"),
}, client.Pointer("123e4567-e89b-12d3-a456-426"))
if err != nil {
log.Fatal(err)
}
if res.ProfileResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
profileRequest |
components.ProfileRequest | ✔️ | N/A | |
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.CreateProfileResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 403, 422 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve a list of all of your profiles.
The results are paginated.
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.Profiles.List(ctx, client.Pointer("pfl_QkEhN94Ba"), client.Pointer[int64](50), 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 | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
from |
*string |
➖ | Provide an ID to start the result set from the item with the given ID and onwards. This allows you to paginate the result set. |
|
limit |
*int64 |
➖ | The maximum number of items to return. Defaults to 50 items. | 50 |
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.ListProfilesResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 400 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve a single profile by its ID.
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.WithTestmode(false),
client.WithSecurity(components.Security{
OrganizationAccessToken: client.Pointer(os.Getenv("CLIENT_ORGANIZATION_ACCESS_TOKEN")),
}),
)
res, err := s.Profiles.Get(ctx, "pfl_5B8cwPMGnU", client.Pointer("123e4567-e89b-12d3-a456-426"))
if err != nil {
log.Fatal(err)
}
if res.ProfileResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
profileID |
string |
✔️ | Provide the ID of the related profile. | pfl_5B8cwPMGnU |
testmode |
*bool |
➖ | You can enable test mode by setting the testmode query parameter to true.Test entities cannot be retrieved when the endpoint is set to live mode, and vice versa. |
|
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.GetProfileResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 404, 410 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |
Update an existing profile.
Profiles are required for payment processing. Normally they are created and updated via the Mollie dashboard. Alternatively, you can use this endpoint to automate profile management.
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.Profiles.Update(ctx, "pfl_5B8cwPMGnU", operations.UpdateProfileRequestBody{
Name: client.Pointer("My new website name"),
Website: client.Pointer("https://example.com"),
Email: client.Pointer("test@mollie.com"),
Phone: client.Pointer("+31208202071"),
Description: client.Pointer("My website description"),
CountriesOfActivity: []string{
"NL",
"GB",
},
BusinessCategory: client.Pointer("OTHER_MERCHANDISE"),
}, client.Pointer("123e4567-e89b-12d3-a456-426"))
if err != nil {
log.Fatal(err)
}
if res.ProfileResponse != nil {
// handle response
}
}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.Profiles.Update(ctx, "pfl_5B8cwPMGnU", operations.UpdateProfileRequestBody{
Name: client.Pointer("My new website name"),
Website: client.Pointer("https://example.com"),
Email: client.Pointer("test@mollie.com"),
Phone: client.Pointer("+31208202071"),
Description: client.Pointer("My website description"),
CountriesOfActivity: []string{
"NL",
"GB",
},
BusinessCategory: client.Pointer("OTHER_MERCHANDISE"),
}, client.Pointer("123e4567-e89b-12d3-a456-426"))
if err != nil {
log.Fatal(err)
}
if res.ProfileResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
profileID |
string |
✔️ | Provide the ID of the related profile. | pfl_5B8cwPMGnU |
requestBody |
operations.UpdateProfileRequestBody | ✔️ | N/A | |
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.UpdateProfileResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 403, 404, 410, 422 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |
Delete a profile. A deleted profile and its related credentials can no longer be used for accepting payments.
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.Profiles.Delete(ctx, "pfl_5B8cwPMGnU", client.Pointer("123e4567-e89b-12d3-a456-426"))
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
profileID |
string |
✔️ | Provide the ID of the related profile. | pfl_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.DeleteProfileResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.ErrorResponse | 404, 410 | application/hal+json |
| apierrors.APIError | 4XX, 5XX | */* |
Retrieve the currently authenticated profile. A convenient alias of the Get profile endpoint.
For a complete reference of the profile object, refer to the Get profile endpoint documentation.
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{
APIKey: client.Pointer(os.Getenv("CLIENT_API_KEY")),
}),
)
res, err := s.Profiles.GetCurrent(ctx, client.Pointer("123e4567-e89b-12d3-a456-426"))
if err != nil {
log.Fatal(err)
}
if res.ProfileResponse != 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.GetCurrentProfileResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |