# Refund

# Endpoint

http://{terminalIp}/devices/cat/authorizeRefund

# Request

Property Type Description
HTTP Headers
Signature String Sha-256 hmac of the json payload.
Content-Type text/plain Even if the payload is a JSON object, POS Bridge parses it as a string, therefore it is important to pass content-type as "text/plain" otherwise the authentication will fail.
JSON
poyntRequestId String UUID of the request.
transactionId String Poynt transaction id of the previous capture or sale transaction.
timeout int Client timeout in milliseconds.
payment JSON Object Required. Contains options for the payment session. Encloses all the properties below. This can be an empty object if amount is not specified.
amount int Optional. Amount to refund in cents. If not provided full amount will be refunded

# Response

NOTE

Most of the response properties are the same as what has already been described in the Sale section. To avoid repetition the table below only lists the new values.

Property Type Description
HTTP Headers
Content-Type application/json Content-type of the payload.
Signature String Sha-256 hmac of the JSON payload.
JSON
Transaction Properties
action String "REFUND"
status String "REFUNDED"
links JSON Array List of link objects showing relationship of this refund to other transactions. Link object properties:

href - transaction id or a related transaction

method - GET. HTTP verb to use to pull this resource

rel - how the transaction is related to this transaction. In the example below, it's the transaction id of the capture that now has been partially refunded.

# Request Example

POST /devices/cat/authorizeRefund HTTP/1.1
Host: 127.0.0.1:55555
User-Agent: curl/7.43.0
Accept: */*
Content-Type: text/plain
Signature: 8ffebf07e1d224588205934d2c535dcd6d7fac9daf0bf4387d102f4c09e76bb1
Content-Length: 231

{
    "poyntRequestId": "7B108C92-BD31-4DDF-B94B-0500F715726F", "transactionId": "402876d3-79d7-4794-a4bf-99bfbaac896c", "timeout": 60000,
    "payment": {
        "amount": 500
    }
}

# Response Example

HTTP/1.1 200 OK
Connection: Keep-Alive
Signature: 7201C30B174448960F39AFEE2CD676FBE207FA3B5E4ADC79518C985CB94019C9
Content-Length: 2701
Content-Type: application/json

{
    "payment": {
        "transactions": [ 
            {
                "action": "REFUND", 
                "status": "REFUNDED", 
                "links": [
                    {
                        "href": "402876d3-79d7-4794-a4bf-99bfbaac896c", 
                        "method": "GET",
                        "rel": "CAPTURE"
                    } 
                ],
Last Updated: 8/14/2023, 1:52:36 PM