Get Payment Methods for an Account
get
/accounts/{accountId}/paymentMethods
Gets the payment methods associated with the specified account.
Request
Path Parameters
-
accountId(required): string
The ID of the account to get payment methods for.
Query Parameters
-
bankAccount.BIC: string
The Business Identifier Code of a bank, to get bankAccountDebit payment methods.Example:
AAAABBCCDD
-
bankAccount.accountNumber: string
The bank account number, to get a bankAccountDebit payment method.
-
bankAccount.bank: string
The name of a bank, to get bankAccountDebit payment methods.Example:
MyName
-
bankCard.cardNumber: string
The card number, to get a bankCard payment method.
-
bankCard.nameOnCard: string
The name on the card, to get bankCard payment methods. You can use bankCard.nameOnCard.like= to get partial matches.Example:
John%20Smith
-
bankCard.type: string
The type of bank card, to get bankCard payment methods. The only valid value for BRM is CREDIT.Example:
CREDIT
-
fields: string
The list of comma-separated fields to return in the response.Example:
status,details.bank
-
limit: integer
The maximum number of results to return. For example, use limit=10 to return the first 10 results only.Example:
10
-
offset: integer
The number of results to offset the response by. For example, use offset=10 to return results 10 and higher.Example:
10
-
type: string
The type of payment methods to get.Allowed Values:
[ "tokenizedCard", "bankAccountDebit", "bankCard" ]
There's no request body for this operation.
Back to TopResponse
Supported Media Types
- application/json
200 Response
The payment methods for the account were returned successfully.
Headers
-
X-Total-Count(required):
Total results
Nested Schema : PaymentMethodType
Type:
object
A payment method.
Show Source
-
@type(required): string
Allowed Values:
[ "tokenizedCard", "bankAccountDebit", "bankCard" ]
The payment method's type. The value of this property determines the content of the details property. -
account: array
array
account
An account that owns or can use the payment method.
-
authorizationCode: string
An authorization code provided by a financial institution. Typically for recurring payments using the payment method.
-
description: string
The payment method's description.
-
details(required): object
object
details
The payment method's details, which differ based on the '@type' property.
-
href(required): string
The payment method's href.
-
id(required): string
The payment method's ID.
-
name: string
The payment method's name.
-
preferred: boolean
Whether this is the preferred payment method for the account, bill unit, or billing cycle specification (true) or not (false).
- relatedParty: array array relatedParty
-
status: string
The payment method's status.
-
statusDate: string
(date-time)
The date the payment method's status was recorded.
-
validFor:
object
TimePeriodType
A period of time.
Nested Schema : account
Type:
array
An account that owns or can use the payment method.
Show Source
-
Array of:
object AccountRefType
An account reference.
Nested Schema : details
Type:
object
The payment method's details, which differ based on the '@type' property.
Nested Schema : TimePeriodType
Type:
object
A period of time.
Show Source
-
endDateTime: string
(date-time)
The end of the time period.
-
startDateTime(required): string
(date-time)
The start of the time period.
Nested Schema : AccountRefType
Type:
object
An account reference.
Show Source
-
@referredType: string
The referred account's type. For example, customer account or financial account.
-
description: string
The referred account's description.
-
href(required): string
The referred account's href.
-
id(required): string
The referred account's ID.
-
name: string
The referred account's name.
Nested Schema : RelatedPartyRefType
Type:
object
A related party.
Show Source
-
@referredType: string
The type of related party. For example, account, customer, or user.
-
href(required): string
The related party's href.
-
id(required): string
The related party's ID.
-
name: string
The related party's name.
-
role: string
The related party's role.
400 Response
Invalid Token
401 Response
Unauthorized
403 Response
Forbidden
405 Response
Method not Allowed
500 Response
Internal Server Error
Examples
The following example shows how to get all payment methods for a specified account by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL.
curl -X GET 'http://host:port/brm/paymentMethods/version/accounts/0.0.0.1+-account+244543/paymentMethod'
Example of the Response Body
The following example shows the contents of the response body in JSON format. Note that the account has three different types of payment method, resulting in different properties under the details property.
[ { "id": "0.0.0.1+-payinfo-cc+238991", "href": "http://host:port/brm/paymentMethods/version/paymentMethod/0.0.0.1+-payinfo-cc+238991", "name": "Mary R's Tokenized Card", "description": null, "validFor": null, "account": [ { "id": "0.0.0.1+-account244543", "href": null, "description": "Mary's primary account" "name": "Mary Robbins", "@baseType": null, "@schemaLocation": null, "@type": null, "@referredType": null } ], "preferred": false, "relatedParty": null, "@type": "tokenizedCard", "authorizationCode": null, "status": null, "statusDate": null, "details": { "brand": "Visa", "type": "CREDIT", "lastFourDigits": "1111", "tokenType": "1", "token": "4111111111111111", "issuer": null } }, { "id": "0.0.0.1+-payinfo-cc+286527", "href": "http://host:port/brm/paymentMethods/version/paymentMethod/0.0.0.1+-payinfo-cc+286527", "name": "Mary R's Bank Card", "description": null, "validFor": null, "account": [ { "id": "0.0.0.1+-account244543", "href": null, "description": "Mary's primary account" "name": "Mary Robbins", "@baseType": null, "@schemaLocation": null, "@type": null, "@referredType": null } ], "preferred": false, "relatedParty": null, "@type": "bankCard", "authorizationCode": null, "status": null, "statusDate": null, "details": { "brand": "VISA", "type": "CREDIT", "cardNumber": "4222222222222" "expirationDate": "2021-02-28T11:59:59+05:30", "cvv": null, "lastFourDigits": "2222", "nameOnCard": "Mary Robbins", "bank": null } }, { "id": "0.0.0.1+-payinfo-dd+240947", "href": "http://host:port/brm/paymentMethods/version/paymentMethod/0.0.0.1+-payinfo-dd+240947", "name": "Mary R's Direct Debit Account", "description": null, "validFor": null, "account": [ { "id": "0.0.0.1+-account244543", "href": null, "description": "Mary's primary account" "name": "Mary Robbins", "@baseType": null, "@schemaLocation": null, "@type": null, "@referredType": null } ], "preferred": true, "relatedParty": null, "@type": "bankAccountDebit", "authorizationCode": null, "status": null, "statusDate": null, "details": { "accountNumber": "12341234", "accountNumberType": "Savings", "BIC": "AAAABBCCDD", "owner": "Mary Robbins", "bank": "My Bank" } }, ]