Create a Payment

post

/payment

Creates a payment.

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json;charset=utf-8 ()
Root Schema : Payment Create
Type: object
Title: Payment Create
A payment, used in payment create requests. The id, href, status, statusDate, and paymentDate properties aren't used in the create request.
Show Source
Nested Schema : Account Ref
Type: object
Title: Account Ref
An account's reference.
Show Source
Nested Schema : Money
Type: object
Title: Money
An amount of money.
Show Source
Nested Schema : Channel Ref
Type: object
Title: Channel Ref
A reference to a channel.
Show Source
Nested Schema : Related Party
Type: object
Title: Related Party
A party related to another object.
Show Source
Nested Schema : paymentItem
Type: array
Payment items which can be assigned to bills.
Show Source
Nested Schema : Payment Method Ref Or Value
Type: object
Title: Payment Method Ref Or Value
A link to the resource containing information about the payment method.
Show Source
  • Title: Base Type
    The object's superclass.
  • Title: Referred Type
    The payment method's type, further refined from the @type value. To create a payment when @type is PaymentMethodRef, this is required, and valid values are tokenizedCard, bankAccountDebit, and bankCard.
  • Title: Schema Location
    A URI to a JSON-Schema file that defines additional attributes and relationships.
  • Title: Type
    The payment method's type. Valid values are PaymentMethodRef for a credit or debit card, Cash, or Check. When the value is PaymentMethodRef, the payment method specified must be the one assigned to the bill unit. If you specify a different payment method, the one assigned to the bill unit will be used instead.
  • account
    Accounts associated with the payment method.
  • Title: Payment Method Description
    The payment method's description.
  • Title: Payment Method Href
    The payment method's href.
  • Title: Payment Method ID
    The payment method's ID.
  • Title: Payment Method Preferred
    Whether this is the preferred payment method (true) or not (false).
  • Title: Payment Method Name
    The payment method's name.
  • Related Party
    Title: Related Party
    A party related to another object.
  • Title: Status
    The payment method's status.
  • Title: Status Date
    The date the payment method's status was recorded.
  • Time Period
    Title: Time Period
    A period of time. You can specify only endDateTime or both endDateTime and startDateTime.
Nested Schema : Payment Item
Type: object
Title: Payment Item
A portion of a payment that can be assigned to a bill.
Show Source
Nested Schema : Entity Ref
Type: object
Title: Entity Ref
An entity reference schema.
Show Source
Nested Schema : account
Type: array
Accounts associated with the payment method.
Show Source
Nested Schema : Time Period
Type: object
Title: Time Period
A period of time. You can specify only endDateTime or both endDateTime and startDateTime.
Show Source
Back to Top

Response

Supported Media Types

201 Response

Created
Body ()
Root Schema : Payment
Type: object
Title: Payment
A payment, including information about the payment, the payment amount, and the payment method.
Show Source
Nested Schema : Account Ref
Type: object
Title: Account Ref
An account's reference.
Show Source
Nested Schema : Money
Type: object
Title: Money
An amount of money.
Show Source
Nested Schema : Channel Ref
Type: object
Title: Channel Ref
A reference to a channel.
Show Source
Nested Schema : Related Party
Type: object
Title: Related Party
A party related to another object.
Show Source
Nested Schema : paymentItem
Type: array
Payment items which can be assigned to bills.
Show Source
Nested Schema : Payment Method Ref Or Value
Type: object
Title: Payment Method Ref Or Value
A link to the resource containing information about the payment method.
Show Source
  • Title: Base Type
    The object's superclass.
  • Title: Referred Type
    The payment method's type, further refined from the @type value. To create a payment when @type is PaymentMethodRef, this is required, and valid values are tokenizedCard, bankAccountDebit, and bankCard.
  • Title: Schema Location
    A URI to a JSON-Schema file that defines additional attributes and relationships.
  • Title: Type
    The payment method's type. Valid values are PaymentMethodRef for a credit or debit card, Cash, or Check. When the value is PaymentMethodRef, the payment method specified must be the one assigned to the bill unit. If you specify a different payment method, the one assigned to the bill unit will be used instead.
  • account
    Accounts associated with the payment method.
  • Title: Payment Method Description
    The payment method's description.
  • Title: Payment Method Href
    The payment method's href.
  • Title: Payment Method ID
    The payment method's ID.
  • Title: Payment Method Preferred
    Whether this is the preferred payment method (true) or not (false).
  • Title: Payment Method Name
    The payment method's name.
  • Related Party
    Title: Related Party
    A party related to another object.
  • Title: Status
    The payment method's status.
  • Title: Status Date
    The date the payment method's status was recorded.
  • Time Period
    Title: Time Period
    A period of time. You can specify only endDateTime or both endDateTime and startDateTime.
Nested Schema : Payment Item
Type: object
Title: Payment Item
A portion of a payment that can be assigned to a bill.
Show Source
Nested Schema : Entity Ref
Type: object
Title: Entity Ref
An entity reference schema.
Show Source
Nested Schema : account
Type: array
Accounts associated with the payment method.
Show Source
Nested Schema : Time Period
Type: object
Title: Time Period
A period of time. You can specify only endDateTime or both endDateTime and startDateTime.
Show Source

400 Response

Bad Request
Body ()
Root Schema : Error
Type: object
Title: Error
Used when an API returns an error, typically with a HTTP error response-code such as 401 (Unauthorized) or 500 (Internal Server Error).
Show Source

401 Response

Unauthorized
Body ()
Root Schema : Error
Type: object
Title: Error
Used when an API returns an error, typically with a HTTP error response-code such as 401 (Unauthorized) or 500 (Internal Server Error).
Show Source

403 Response

Forbidden
Body ()
Root Schema : Error
Type: object
Title: Error
Used when an API returns an error, typically with a HTTP error response-code such as 401 (Unauthorized) or 500 (Internal Server Error).
Show Source

405 Response

Method Not allowed
Body ()
Root Schema : Error
Type: object
Title: Error
Used when an API returns an error, typically with a HTTP error response-code such as 401 (Unauthorized) or 500 (Internal Server Error).
Show Source

409 Response

Conflict
Body ()
Root Schema : Error
Type: object
Title: Error
Used when an API returns an error, typically with a HTTP error response-code such as 401 (Unauthorized) or 500 (Internal Server Error).
Show Source

500 Response

Internal Server Error
Body ()
Root Schema : Error
Type: object
Title: Error
Used when an API returns an error, typically with a HTTP error response-code such as 401 (Unauthorized) or 500 (Internal Server Error).
Show Source
Back to Top

Examples

The following example shows how to create a payment 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/payment/version/payment' -d @paymentCreate.json

Example of Request Body

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

{
     "@type":"Payment_Create",
     "account":{
         "id":"0.0.0.1+-account+84808"
     },
     "paymentMethod":{ 
         "id":"0.0.0.1+-payinfo-cc+77289",
         "@referredType": "bankCard",
         "@type": "PaymentMethodRef"
     },
     "totalAmount":{
         "value":10,
         "unit":"USD"
     },
     "description": "New Payment"
}

Example of Response Body

The following is an example of the response body in JSON format.

{
    "id": "0.0.0.1+-item-payment+207561",
    "href": "http://host:port/brm/payment/version/payment/0.0.0.1+-item-payment+207561",
    "authorizationCode": null,
    "correlatorId": null,
    "description": null,
    "name": null,
    "paymentDate": null,
    "status": null,
    "statusDate": null,
    "account": {
        "id": "0.0.0.1+-account+84808",
        "href": null,
        "description": null,
        "name": "Grace Wang",
        "@baseType": null,
        "@schemaLocation": null,
        "@type": null,
        "@referredType": "billingAccount"
    },
    "amount": null,
    "channel": null,
    "payer": null,
    "paymentItem": null,
    "paymentMethod": {
        "id": "0.0.0.1+-payinfo-cc+97134",
        "href": "http://host:port/brm/paymentMethods/version/paymentMethod/0.0.0.1+-payinfo-cc+97134",
        "description": null,
        "isPreferred": null,
        "name": Grace Wang's Credit Card,
        "status": null,
        "statusDate": null,
        "account": null,
        "relatedParty": null,
        "validFor": null,
        "@baseType": "PaymentMethodRefOrValue",
        "@schemaLocation": null,
        "@type": PaymentMethodRefOrValue,
        "@referredType": null
    },
    "taxAmount": null,
    "totalAmount": {
        "unit": "USD",
        "value": 10,
        "@baseType": null,
        "@schemaLocation": null,
        "@type": null
    },
    "@baseType": "Payment",
    "@schemaLocation": null,
    "@type": "Payment"
}
Back to Top