Create a Refund

post

/refund

Creates a refund.

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json;charset=utf-8 ()
Root Schema : Refund Create
Type: object
Title: Refund Create
A refund for a payment, used in the create refund request. The paymentMethod 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 refunded instead.

The id, href, status, statusDate, and refundDate properties are not used in the create request.

Show Source
Nested Schema : Account Ref
Type: object
Title: Account Ref
A reference to an account.
Show Source
Nested Schema : Money
Type: object
A base / value business entity used to represent money.
Show Source
Nested Schema : Channel Ref
Type: object
Title: Channel Ref
A reference to a channel.
Show Source
Nested Schema : Payment Ref
Type: object
Title: Payment Ref
A payment captured as a reference on an order. Used when a payment is made immediately on an order rather than at a later billing date.
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
Nested Schema : Related Party
Type: object
Title: Related Party
A party related to another object.
Show Source
Nested Schema : account
Type: array
Accounts associated with the payment method.
Show Source
Nested Schema : TimePeriod
Type: object
A period of time.
Show Source
Back to Top

Response

Supported Media Types

201 Response

Created
Body ()
Root Schema : Refund
Type: object
Title: Refund
A refund for a payment.
Show Source
Nested Schema : Account Ref
Type: object
Title: Account Ref
A reference to an account.
Show Source
Nested Schema : Money
Type: object
A base / value business entity used to represent money.
Show Source
Nested Schema : Channel Ref
Type: object
Title: Channel Ref
A reference to a channel.
Show Source
Nested Schema : Payment Ref
Type: object
Title: Payment Ref
A payment captured as a reference on an order. Used when a payment is made immediately on an order rather than at a later billing date.
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
Nested Schema : Related Party
Type: object
Title: Related Party
A party related to another object.
Show Source
Nested Schema : account
Type: array
Accounts associated with the payment method.
Show Source
Nested Schema : TimePeriod
Type: object
A period of time.
Show Source

400 Response

Bad Request
Body ()
Root Schema : Error
Type: object
This is used when an API throws an error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source

401 Response

Unauthorized
Body ()
Root Schema : Error
Type: object
This is used when an API throws an error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source

403 Response

Forbidden
Body ()
Root Schema : Error
Type: object
This is used when an API throws an error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source

405 Response

Method Not allowed
Body ()
Root Schema : Error
Type: object
This is used when an API throws an error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source

409 Response

Conflict
Body ()
Root Schema : Error
Type: object
This is used when an API throws an error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source

500 Response

Internal Server Error
Body ()
Root Schema : Error
Type: object
This is used when an API throws an error, typically with a HTTP error response-code (3xx, 4xx, 5xx).
Show Source
Back to Top

Examples

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

When the refund is created successfully, the only response is a 201 status code.

Example of Request Body

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

{
    "@type": "RefundCreate",
    "account": {
        "id": "0.0.0.1+-account+84808"
    },
    "paymentMethod": { 
        "id": "0.0.0.1+-payinfo-dd+249648",
        "@type": "PaymentMethodRef"
    },
    "totalAmount": {
        "value": 10,
        "unit": "USD"
    },
    "description": "Refunding service fee."
}

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
        "id": "0.0.0.1+-item-refund+82547",
        "href": "http://host:port/brm/payment/version/refund/0.0.0.1+-item-refund+82547",
        "authorizationCode": null,
        "correlatorId": "R1-30",
        "description": "Item refund",
        "name": "Billing Event Log",
        "refundDate": "2021-12-09T00:38:15-08:00",
        "status": "Success",
        "statusDate": "2021-12-09T00:38:15-08:00",
        "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": {
            "id": "0",
            "href": null,
            "name": "Unspecified",
            "@baseType": null,
            "@schemaLocation": null,
            "@type": null,
            "@referredType": null
        },
        "payment": null,
        "paymentMethod": {
            "id": "0.0.0.1+-payinfo-dd+249648",
            "href": null,
            "description": null,
            "isPreferred": true,
            "name": "Grace Wang's Direct Debit Account",
            "status": null,
            "statusDate": null,
            "account": "0.0.0.1+-account+104221",
            "relatedParty": null,
            "validFor": null,
            "@baseType": "PaymentMethodRefOrValue",
            "@schemaLocation": null,
            "@type": "PaymentMethodRef",
            "@referredType": null
        },
        "requestor": null,
        "taxAmount": null,
        "totalAmount": {
            "unit": "USD",
            "value": 10.0
        },
        "@baseType": "Refund",
        "@schemaLocation": null,
        "@type": "Refund"
    }
Back to Top