Solutions Swish for merchants Test Connection

7 Retrieve refund confirmation callback

7 Retrieve refund confirmation callback

7 Retrieve refund confirmation callback

Merchants can retrieve refund confirmation callback by sending GET HTTP to URL:

HTTPS://mss.cpc.getswish.net/swish-cpcapi/api/v1/refunds/{id}

The URL is the Location defined in a response of create refund request, check section 7.1 for an example.


7.1 Example retrieve refund confirmation callback

curl -v --request GET https://mss.cpc.getswish.net/swish-cpcapi/api/v1/refunds/ABC2D7406ECE4542A80152D909EF9F6B
< HTTP/1.1 200 OK {
"id": "ABC2D7406ECE4542A80152D909EF9F6B",
"payerPaymentReference": "0123456789",
"originalPaymentReference": "6D6CD7406ECE4542A80152D909EF9F6B",
"callbackUrl": "https://example.com/api/swishcb/refunds",
"payerAlias": "1231234567890",
"payeeAlias": "07211234567",
"amount": "100",
"currency": "SEK",
"message": "Refund for Kingston USB Flash Drive 8 GB",
"status": "PAID",
"dateCreated": "2015-02-19T22:01:53+01:00",
"datePaid": "2015-02-19T22:03:53+01:00"
}

7.2 HTTP status codes

Potential HTTP status codes returned for retrieve refund confirmation callback:

HTTP status codesReturned scenarios
200 OKReturned when refund was found. Will return Refund Object..
401 UnauthorizedReturned when there are authentication problems with the certificate. Or the Swish number in the certificate is not enrolled. Will return nothing else.
404 Not foundReturned when no refund was found or it was not created by the Merchant. Will return nothing else.
500 Internal Server ErrorReturned if there was some unknown/unforeseen error that occurred on the server, this should normally not happen. Will return nothing else.