Create and Link an Account Group

Outcome

Use this guide to create an account group and associate it with an account through card issuance or after a card already exists.

An account group is a reusable configuration container. Creating one does not create a customer, account, card product, account, or card. Linking a group through a card associates the card’s underlying account with that group.

Who this is for

AudienceResponsibility
Backend EngineerCreates groups, stores group IDs, links them to accounts, and implements retry handling.
Product ManagerDefines the business purpose, intended controls, and which accounts should be included.
Operations or Risk TeamConfigures and validates the policies, rules, or fees associated with the group.

Overview

Prerequisites

PrerequisiteDescription
Client and API accessA valid client ID and entitlement to call the required PayAPI endpoints.

The configuration is done during the onboarding in cooperation the Paymentology Implementation team.
Group designAn agreed purpose, group type, risk level, and ownership model.

The configuration is done during the onboarding in cooperation the Paymentology Implementation team.
Existing card and accountRequired only when associating a group after card issuance.
Card issuance prerequisitesRequired only when associating a group during Create Card: configured card product, customer, and account or account-creation inputs.

The configuration is done during the onboarding in cooperation the Paymentology Implementation team. It is created in PayControl>Clients List>Add Product/Add Customer.

A customer, card product, account, and card are not prerequisites for creating the account group itself.

Recommedned flow

Define the group

Before calling the API, agree:

  • The business purpose of the group.
  • The accounts that should be governed together.
  • The group type and risk level.
  • The team responsible for its configuration and operational support.

Avoid using a group as an informal label. Its type and linked configuration can affect cardholder behaviour.


Create the account group

API Reference: Create Group

Required fields:

FieldValue / purpose
client_idYour program client ID.
api_call_unique_identifierUnique identifier for this create request.
group_nameA short, durable name for the group, up to 50 characters. Make it meaningful to operational users; for example, UK_PREMIUM_DEBIT rather than Group 1.
group_descA business-readable description, up to 100 characters. State the group’s purpose and intended population; for example, Premium UK debit accounts with enhanced limits.
group_typeDefines the functional classification of the group. Select the value that matches the capability being configured: 2 general container, 3 fees, 4 authorisation activities, 5 settlement activities, 6 scheduled tasks, 7 fraud assessment, 8 AI rules, or 9 wallet interactions. Choose the type during design; do not use it as a free-form label.
risk_levelYour agreed risk classification for the group, up to 10 characters. The API requires a non-empty value, but the permitted vocabulary and its operational meaning should be defined by the program’s risk design.

Store the returned group_id. This is the identifier used when associating the group with accounts.

Alternative: create the group in PayControl

The same account-group setup can be completed in the PayControl UI by an authorised operations or configuration user.

Use the UI where group creation is an operational configuration activity; use the API where your backend must create groups as part of a controlled automated workflow. These are alternative administration paths, not separate group types.

Whichever path is used:

  • Store the resulting group ID in your system of record.
  • Avoid creating the same business group through both the UI and API.
  • Define ownership for future configuration changes and membership updates.
  • Validate the group’s configured behaviour in UAT before associating production accounts.

Associate the group during card issuance

Where the account is being created or selected as part of card issuance, include group_id in:

API Reference: Create Card

FieldValue / purpose
group_idOne or more existing group IDs, supplied as a comma-separated string; for example, "55,56".
ac_idExisting account to associate with the group.

Validate every group ID before issuing the card. An invalid ID in a comma-separated list can result in that individual association being skipped.


Associate a group with an existing card

Use the group ID in the path and provide one or more existing public card tokens.

API Reference: Add cards to account group

This operation resolves the account linked to each supplied card and associates that account with the account group. It is idempotent: repeating the same successful association should not create duplicate membership.

What is created or changed

RecordCreated or changed?
Account groupCreated by pws_group_create.
Group IDCreated and returned by the API.
CustomerNo.
Card productNo.
AccountNo; an existing account is associated with the group.
CardNo; a card can be used to identify the account to associate.
Account-group membershipCreated when the group is linked during card issuance or through the existing-card endpoint.

Important considerations

  • Account groups operate at account scope. If multiple cards share one account, associating that account can affect all cards that use it.
  • Creating the group alone does not activate any business control. Configure and test the intended rules, actions, or fees separately.
  • Treat api_call_unique_identifier as a durable request-correlation value. If the outcome is uncertain, reconcile before submitting another create request.
  • Store the group ID with its business purpose, owner, and lifecycle status in your own system.
  • Do not use a new group for every cardholder unless the intended policy genuinely requires account-level isolation.
  • Changes to group membership should be auditable and owned by a clearly defined operational team.

Testing

Test caseExpected result
Create groupA group is created and the response returns its ID.
Missing required fieldThe request fails and no group is created.
Duplicate or timed-out create requestThe client reconciles the outcome before attempting another create operation.
Link during card issuanceThe issued card’s account is associated with each valid requested group.
Link an existing cardThe account behind the supplied public card token is associated with the target group.
Repeat associationNo duplicate account-group membership is created.
Shared-account scenarioAll cards using the same account behave according to the configured account-group policy.
Rule or fee validationThe configured business behaviour is observed in the target UAT scenario.

Errors, retries, and request correction

Use header.error_id and header.error_desc as the primary outcome signal. Do not decide whether to retry from the HTTP status alone.

Persist the original api_call_unique_identifier, requested group name, client ID, and returned group ID before proceeding to configuration or account association.

Retry automatically

Response or situationError descriptionAutomatic retry?Required retry behaviour
No response / network timeoutThe caller did not receive a response. The create operation may still have completed.ControlledFirst reconcile whether the group was created using the original request details. Retry only if creation cannot be confirmed, using the same business request and original identifier where supported.
Temporary platform or gateway failureA transient service, gateway, or infrastructure failure is explicitly indicated.ControlledRetry with bounded backoff. Limit attempts and alert the operations team when the limit is reached. Do not create a second group with a different name or identifier as a workaround.
Service unavailable after a previously successful requestThe client received an uncertain transport failure, but the group is later found to exist.No retry requiredTreat the operation as successful. Store the returned group ID and continue with configuration or association.

Do not retry automatically

Response or situationError descriptionAutomatic retry?Required correction
Request validation failureA required field is missing or invalid, for example group_name, group_desc, group_type, risk_level, client_id, or api_call_unique_identifier.NoCorrect the request according to the API contract. Validate field lengths, allowed group_type values, and approved risk_level values before resubmission.
Authentication or permission failureThe credentials are invalid, expired, or not entitled to create groups for the specified client.NoCorrect credentials, client access, or feature entitlement. Do not retry until access is confirmed.
Invalid clientThe supplied client_id does not identify an authorised client.NoCorrect the client ID and confirm that the calling credentials are authorised for it.
Duplicate or conflicting create requestThe request conflicts with an existing group or a previously used request identifier.NoReconcile the original request and use the existing group where appropriate. Do not submit another create request merely to bypass the conflict.
Unsupported group classificationThe requested group_type or risk_level is not valid for the target environment or agreed design.NoSelect an approved classification and confirm its intended configuration before resubmitting.
Successful response with a group IDThe response includes body.id.NoTreat the group as created. Store the ID and continue with separate configuration and account-association steps.
Unexpected application errorThe API returns an error that is neither clearly transient nor explained by the request.NoStop automatic processing. Capture the request identifier, timestamp, client ID, request body excluding sensitive information, and full API response; then raise a support case.

Related APIs


Did this page help you?