Create a Payment Method

post

/paymentMethod

Creates a payment method.

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
A 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
    An account that owns or can use the payment method.
  • An authorization code provided by a financial institution. Typically for recurring payments using the payment method.
  • The payment method's description.
  • details
    The payment method's details, which differ based on the type property. Use the following properties:
    • If type=bankAccountDebit, use the following properties:
      • 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.
  • The payment method's name.
  • 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
    The related party that owns the payment method.
  • The payment method's status.
  • Allowed Values: [ "bankAccountDebit" ]
    The payment method's type. The value of this property determines the content of the details property.
  • TimePeriodType
    A period of time.
Nested Schema : account
Type: array
An account that owns or can use the payment method.
Show Source
Nested Schema : details
Type: object
The payment method's details, which differ based on the type property. Use the following properties:
  • If type=bankAccountDebit, use the following properties:
    • 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 : relatedParty
Type: array
The related party that owns the payment method.
Show Source
Nested Schema : TimePeriodType
Type: object
A period of time.
Show Source
Nested Schema : AccountRefType
Type: object
An account reference.
Show Source
Nested Schema : RelatedPartyRefType
Type: object
A related party.
Show Source
Back to Top

Response

Supported Media Types

201 Response

The payment method was created successfully.
Headers
  • The location to get the new payment method.
Body ()
Root Schema : PaymentMethodType
Type: object
A payment method.
Show Source
Nested Schema : account
Type: array
An account that owns or can use the payment method.
Show Source
Nested Schema : details
Type: object
The payment method's details, which differ based on the '@type' property.
Nested Schema : relatedParty
Type: array
The related party that owns the payment method.
Show Source
Nested Schema : TimePeriodType
Type: object
A period of time.
Show Source
Nested Schema : AccountRefType
Type: object
An account reference.
Show Source
Nested Schema : RelatedPartyRefType
Type: object
A related party.
Show Source

400 Response

Bad Request

401 Response

Unauthorized

403 Response

Forbidden

404 Response

Not Found

405 Response

Method not Allowed

409 Response

Conflict

500 Response

Internal Server Error
Back to Top

Examples

The following example shows how to create 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

Example of Request Body

The following is an example of the contents of the createPaymentMethod.json file sent as the request body.

{
    "name": "Grace Wang's Direct Debit Account",
    "description": null,
    "validFor": null,
    "account": [
        {
            "id": "0.0.0.1+-account+104221",
            "href": null,
            "description": "Grace's Primary Account",
            "name": "Grace Wang",
            "@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": "Grace W",
        "bank": "My Bank"
    }
}

Example of 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": "Grace Wang's Direct Debit Account",
    "description": null,
    "validFor": null,
    "account": [
        {
            "id": "0.0.0.1+-account+104221",
            "href": null,
            "description": "Grace's Primary Account",
            "name": "Grace Wang",
            "@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": "Grace Wang",
        "bank": "My Bank"
    }
}
Back to Top