Create a Payment Method
post
/paymentMethod
Creates a payment method.
Request
There are no request parameters for this operation.
Supported Media Types
- application/json
Root Schema : schema
Type:
objectA payment method, used in create requests. The id, href,and statusDate payment method properties that appear in get requests are not used in create requests. They are system generated.
Show Source
-
account: array
account
The account number or external ID of the 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
details
The payment method's details, which differ based on the type property. Use the following properties for type=bankAccountDebit:
- accountNumber: Required. The bank account's IBAN or SWIFT number.
- accountNumberType: Required. The bank account's type. Can be one of the following:
- None (for an account with no type)
- Checking
- Savings
- Corporate
- BIC: Optional. The Business Identifier Code for the account's bank.
- owner: Optional. The bank account's owner.
- bank: Optional. The name of the account's bank.
-
name: string
The payment method's name.
-
preferred: boolean
Whether this is the preferred payment method for the account (true) or not (false). If set to true, the payment method is assigned to the account's default bill unit.
- relatedParty: array relatedParty
-
status: string
The payment method's status.
-
type(required): string
Allowed Values:
[ "bankAccountDebit" ]The payment method's type. The value of this property determines the content of the details property. -
validFor:
TimePeriodType
A period of time.
Nested Schema : account
Type:
arrayThe account number or external ID of the account that owns or can use the payment method.
Show Source
-
Array of:
object AccountRefType
An account reference.
Nested Schema : details
Type:
objectThe payment method's details, which differ based on the type property. Use the following properties for type=bankAccountDebit:
- accountNumber: Required. The bank account's IBAN or SWIFT number.
- accountNumberType: Required. The bank account's type. Can be one of the following:
- None (for an account with no type)
- Checking
- Savings
- Corporate
- BIC: Optional. The Business Identifier Code for the account's bank.
- owner: Optional. The bank account's owner.
- bank: Optional. The name of the account's bank.
Nested Schema : TimePeriodType
Type:
objectA 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:
objectAn 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:
objectA 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.
Response
Supported Media Types
- application/json
201 Response
The payment method was created successfully.
Headers
-
location:
The location to get the new payment method.
Root Schema : PaymentMethodType
Type:
objectA payment method.
Show Source
-
@type(required): string
Allowed Values:
[ "tokenizedCard", "bankAccountDebit", "bankCard", "invoice" ]The payment method's type: tokenizedCard, bankAccountDebit, bankCard, or invoice. The value of this property determines the content of the details property. -
account: 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
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 relatedParty
-
status: string
The payment method's status.
-
statusDate: string
(date-time)
The date the payment method's status was recorded.
-
validFor:
TimePeriodType
A period of time.
Nested Schema : account
Type:
arrayAn account that owns or can use the payment method.
Show Source
-
Array of:
object AccountRefType
An account reference.
Nested Schema : details
Type:
objectThe payment method's details, which differ based on the @type property.
Nested Schema : TimePeriodType
Type:
objectA 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:
objectAn 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:
objectA 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
The request isn't valid.
401 Response
The client doesn't have the correct privileges.
403 Response
The request wasn't authorized.
404 Response
The requested resource couldn't be found.
405 Response
This method is not allowed.
409 Response
The request could not be processed due to the conflict with the existing state of the resource.
500 Response
The system encountered an internal error.
Examples
The following example shows how to create a payment method by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.
The -d option specifies the file to attach as the request body.
curl -X POST 'http://host:port/brm/paymentMethods/version/paymentMethod' -d @createPaymentMethod.json
Request Body
The following is an example of the contents of the createPaymentMethod.json file sent as the request body. This example shows account.id set to an account ID (0.0.0.1+-account+104221). Alternatively, you could set account.id to an external ID.
{
"name": "John Frank's Direct Debit Account",
"description": null,
"validFor": null,
"account": [
{
"id": "0.0.0.1+-account+104221",
"href": null,
"description": "John's Primary Account",
"name": "John Frank",
"@baseType": null,
"@schemaLocation": null,
"@type": null,
"@referredType": null
}
],
"preferred": true,
"relatedParty": null,
"type": "bankAccountDebit",
"authorizationCode": null,
"status": null,
"details": {
"accountNumber": "12345678901236491",
"accountNumberType": "Savings",
"BIC": "111122334",
"owner": "John Frank",
"bank": "My Bank"
}
}
Response Body
The following is an example of the response body in JSON format.
{
"id": "0.0.0.1+-payinfo-dd+249648",
"href": "http://host:port/brm/paymentMethods/version/paymentMethod/0.0.0.1+-payinfo-dd+249648",
"name": "John Frank's Direct Debit Account",
"description": null,
"validFor": null,
"account": [
{
"id": "0.0.0.1+-account+104221",
"href": null,
"description": "John's Primary Account",
"name": "John Frank",
"@baseType": null,
"@schemaLocation": null,
"@type": null,
"@referredType": null
}
],
"preferred": true,
"relatedParty": null,
"@type": "bankAccountDebit",
"authorizationCode": null,
"status": null,
"statusDate": null,
"details": {
"accountNumber": "12345678901236491",
"accountNumberType": "Savings",
"BIC": "111122334",
"owner": "John Frank",
"bank": "My Bank"
}
}