Create a Refund
/refund
Request
There are no request parameters for this operation.
- application/json;charset=utf-8
object
Refund Create
The id, href, status, statusDate, and refundDate properties are not used in the create request.
-
@baseType: string
Title:
Base Type
The object's superclass. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON-Schema file that defines additional attributes and relationships. -
@type: string
Title:
Type
The object's subclass. -
account(required): object
Account Ref
Title:
Account Ref
A reference to an account. -
amount: object
Money
A base / value business entity used to represent money.
-
authorizationCode: string
Title:
Authorization code
An authorization code from an external payment gateway. -
channel: object
Channel Ref
Title:
Channel Ref
A reference to a channel. -
correlatorId: string
Title:
correlator ID
An refund correlation ID from a client application. -
description: string
Title:
Refund Description
The refund's description. -
name: string
Title:
Refund Name
The refund's name. -
payment: object
Payment Ref
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. -
paymentMethod(required): object
Payment Method Ref Or Value
Title:
Payment Method Ref Or Value
A link to the resource containing information about the payment method. -
refundDate: string
(date-time)
Title:
Refund Date
The date when the refund was made. -
requestor: object
Related Party
Title:
Related Party
A party related to another object. -
taxAmount: object
Money
A base / value business entity used to represent money.
-
totalAmount(required): object
Money
A base / value business entity used to represent money.
object
Account Ref
-
@baseType: string
Title:
Base Type
The object's superclass. -
@referredType: string
Title:
Referred Type
The object's type in the target system, if baseType and type need further disambiguation. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON-Schema file that defines additional attributes and relationships. -
@type: string
Title:
Type
The object's subclass. -
description: string
Title:
Description
The account reference's description. -
href: string
Title:
Account Href
The account reference's href. -
id(required): string
Title:
Account ID
The account reference's ID. -
name: string
Title:
Account Name
The account reference's name.
object
-
unit(required): string
Refers to the currency (ISO4217 norm uses 3 letters to define the currency).
-
value(required): number
(float)
A positive floating point number.
object
Channel Ref
-
@baseType: string
Title:
Base Type
The object's superclass. -
@referredType: string
Title:
Referred Type
The object's type in the target system, if baseType and type need further disambiguation. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON-Schema file that defines additional attributes and relationships. -
@type: string
Title:
Type
The object's subclass. -
href: string
Title:
Channel Href
The channel's href. -
id(required): string
Title:
Channel ID
The channel's ID. -
name: string
Title:
Channel Name
The channel's name.
object
Payment Ref
-
@baseType: string
Title:
Base Type
The object's superclass. -
@referredType: string
Title:
Referred Type
The object's type in the target system, if baseType and type need further disambiguation. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON schema file that defines additional attributes and relationships. -
@type: string
Title:
Type
The object's subclass. -
amount: object
Money
A base / value business entity used to represent money.
-
href: string
Title:
Payment Href
The payment reference's href. -
id(required): string
Title:
Payment ID
The payment reference's ID. -
name: string
Title:
Payment Name
The payment reference's name.
object
Payment Method Ref Or Value
-
@baseType: string
Title:
Base Type
The object's superclass. -
@referredType: string
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. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON-Schema file that defines additional attributes and relationships. -
@type(required): string
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: array
account
Accounts associated with the payment method.
-
description: string
Title:
Payment Method Description
The payment method's description. -
href: string
Title:
Payment Method Href
The payment method's href. -
id(required): string
Title:
Payment Method ID
The payment method's ID. -
isPreferred: boolean
Title:
Payment Method Preferred
Whether this is the preferred payment method (true) or not (false). -
name: string
Title:
Payment Method Name
The payment method's name. - relatedParty: object Related Party
-
status: string
Title:
Status
The payment method's status. -
statusDate: string
(date-time)
Title:
Status Date
The date the payment method's status was recorded. -
validFor: object
TimePeriod
A period of time.
object
Related Party
-
@baseType: string
Title:
Base Type
The object's superclass. -
@referredType(required): string
Title:
Referred Type
The object's type in the target system, if baseType and type need further disambiguation. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON-Schema file that defines additional attributes and relationships. -
@type: string
Title:
Type
The object's subclass. -
href: string
Title:
Href
The party's href. -
id(required): string
Title:
Party ID
The party's ID. -
name: string
Title:
Party Name
The party's name. -
role: string
Title:
Party Role
The party's role.
array
-
Array of:
object Account Ref
Title:
Account Ref
A reference to an account.
object
-
endDateTime: string
(date-time)
Title:
End Time Period
The end of the time period in IETC-RFC-3339 format. -
startDateTime: string
(date-time)
Title:
Start Time Period
The start of the time period in IETC-RFC-3339 format.
Response
- application/json;charset=utf-8
201 Response
object
Refund
-
@baseType: string
Title:
Base Type
The object's superclass. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON-Schema file that defines additional attributes and relationships. -
@type: string
Title:
Type
The object's subclass. -
account(required): object
Account Ref
Title:
Account Ref
A reference to an account. -
amount: object
Money
A base / value business entity used to represent money.
-
authorizationCode: string
Title:
Authorization code
An authorization code from an external payment gateway. -
channel: object
Channel Ref
Title:
Channel Ref
A reference to a channel. -
correlatorId: string
Title:
correlator ID
An refund correlation ID from a client application. -
description: string
Title:
Refund Description
The refund's description. -
href: string
Title:
Refund Href
The refund's href. -
id: string
Title:
Refund ID
The refund's ID. -
name: string
Title:
Refund Name
The refund's name. -
payment: object
Payment Ref
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. -
paymentMethod(required): object
Payment Method Ref Or Value
Title:
Payment Method Ref Or Value
A link to the resource containing information about the payment method. -
refundDate: string
(date-time)
Title:
Refund Date
The date when the refund was made. -
requestor: object
Related Party
Title:
Related Party
A party related to another object. -
status: string
Title:
Refund Status
The refund's status. -
statusDate: string
(date-time)
Title:
Status Date
The date when the refund's status was recorded. -
taxAmount: object
Money
A base / value business entity used to represent money.
-
totalAmount: object
Money
A base / value business entity used to represent money.
object
Account Ref
-
@baseType: string
Title:
Base Type
The object's superclass. -
@referredType: string
Title:
Referred Type
The object's type in the target system, if baseType and type need further disambiguation. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON-Schema file that defines additional attributes and relationships. -
@type: string
Title:
Type
The object's subclass. -
description: string
Title:
Description
The account reference's description. -
href: string
Title:
Account Href
The account reference's href. -
id(required): string
Title:
Account ID
The account reference's ID. -
name: string
Title:
Account Name
The account reference's name.
object
-
unit(required): string
Refers to the currency (ISO4217 norm uses 3 letters to define the currency).
-
value(required): number
(float)
A positive floating point number.
object
Channel Ref
-
@baseType: string
Title:
Base Type
The object's superclass. -
@referredType: string
Title:
Referred Type
The object's type in the target system, if baseType and type need further disambiguation. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON-Schema file that defines additional attributes and relationships. -
@type: string
Title:
Type
The object's subclass. -
href: string
Title:
Channel Href
The channel's href. -
id(required): string
Title:
Channel ID
The channel's ID. -
name: string
Title:
Channel Name
The channel's name.
object
Payment Ref
-
@baseType: string
Title:
Base Type
The object's superclass. -
@referredType: string
Title:
Referred Type
The object's type in the target system, if baseType and type need further disambiguation. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON schema file that defines additional attributes and relationships. -
@type: string
Title:
Type
The object's subclass. -
amount: object
Money
A base / value business entity used to represent money.
-
href: string
Title:
Payment Href
The payment reference's href. -
id(required): string
Title:
Payment ID
The payment reference's ID. -
name: string
Title:
Payment Name
The payment reference's name.
object
Payment Method Ref Or Value
-
@baseType: string
Title:
Base Type
The object's superclass. -
@referredType: string
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. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON-Schema file that defines additional attributes and relationships. -
@type(required): string
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: array
account
Accounts associated with the payment method.
-
description: string
Title:
Payment Method Description
The payment method's description. -
href: string
Title:
Payment Method Href
The payment method's href. -
id(required): string
Title:
Payment Method ID
The payment method's ID. -
isPreferred: boolean
Title:
Payment Method Preferred
Whether this is the preferred payment method (true) or not (false). -
name: string
Title:
Payment Method Name
The payment method's name. - relatedParty: object Related Party
-
status: string
Title:
Status
The payment method's status. -
statusDate: string
(date-time)
Title:
Status Date
The date the payment method's status was recorded. -
validFor: object
TimePeriod
A period of time.
object
Related Party
-
@baseType: string
Title:
Base Type
The object's superclass. -
@referredType(required): string
Title:
Referred Type
The object's type in the target system, if baseType and type need further disambiguation. -
@schemaLocation: string
(uri)
Title:
Schema Location
A URI to a JSON-Schema file that defines additional attributes and relationships. -
@type: string
Title:
Type
The object's subclass. -
href: string
Title:
Href
The party's href. -
id(required): string
Title:
Party ID
The party's ID. -
name: string
Title:
Party Name
The party's name. -
role: string
Title:
Party Role
The party's role.
array
-
Array of:
object Account Ref
Title:
Account Ref
A reference to an account.
object
-
endDateTime: string
(date-time)
Title:
End Time Period
The end of the time period in IETC-RFC-3339 format. -
startDateTime: string
(date-time)
Title:
Start Time Period
The start of the time period in IETC-RFC-3339 format.
400 Response
object
-
@baseType: string
This defines the super-class when sub-classing.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
This defines the sub-class entity name when sub-classing.
-
code(required): string
Refers to application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
Displays the HTTP error code extension.
401 Response
object
-
@baseType: string
This defines the super-class when sub-classing.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
This defines the sub-class entity name when sub-classing.
-
code(required): string
Refers to application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
Displays the HTTP error code extension.
403 Response
object
-
@baseType: string
This defines the super-class when sub-classing.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
This defines the sub-class entity name when sub-classing.
-
code(required): string
Refers to application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
Displays the HTTP error code extension.
405 Response
object
-
@baseType: string
This defines the super-class when sub-classing.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
This defines the sub-class entity name when sub-classing.
-
code(required): string
Refers to application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
Displays the HTTP error code extension.
409 Response
object
-
@baseType: string
This defines the super-class when sub-classing.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
This defines the sub-class entity name when sub-classing.
-
code(required): string
Refers to application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
Displays the HTTP error code extension.
500 Response
object
-
@baseType: string
This defines the super-class when sub-classing.
-
@schemaLocation: string
(uri)
A URI to a JSON-schema file that defines additional attributes and relationships.
-
@type: string
This defines the sub-class entity name when sub-classing.
-
code(required): string
Refers to application relevant detail, defined in the API or a common list.
-
message: string
More details and corrective actions related to the error which can be shown to a client user.
-
reason(required): string
Explanation of the reason for the error which can be shown to a client user.
-
referenceError: string
(uri)
URI of documentation describing the error.
-
status: string
Displays the HTTP error code extension.
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" }