Disputes
The Dispute resource
{"code": "UNAUTHORIZED","description": "I did not make, authorize, or participate in this transaction","tooltip": "Choose this if you don't know the merchant or have never purchased anything from them","subOptions": [{"code": "UNEXPECTEDLY_CHARGED_AGAIN","description": "A past merchant unexpectedly charged me again","isFraud": false,"supportsMultipleTransactions": false},{"code": "UNWANTED_SUBSCRIPTION","description": "I've been charged for a subscription without my permission","isFraud": false,"supportsMultipleTransactions": false},{"code": "CARD_POSSESSION","description": "I don't recognise a transaction","isFraud": true,"supportsMultipleTransactions": true,"tooltip": "Choose this if you had your card at the time of the transactions, or if you think your card details have been compromised"},{"code": "CARD_NO_POSSESSION","description": "My card was lost or stolen","isFraud": true,"supportsMultipleTransactions": true,"tooltip": "Choose this if you didn't have your card at the time of the transactions"}]}
Retrieve dispute reasons
GET /v3/spend/profiles/{{profileId}}/dispute-form/reasons
Retrieves the list of possible reasons for submitting a dispute.
Response
Returns a set of dispute objects.
curl -X GET https://api.sandbox.transferwise.tech/v3/spend/profiles/{{profileId}}/dispute-form/reasons \-H 'Authorization: Bearer <your api token>'
Dispute dynamic flows entry point
GET /v3/spend/profiles/{{profileId}}/dispute-form/flows/{{scheme}}/{{reason}}?transactionId={{transactionId}}
Retrieves the JSON for initiating the dispute flow. The returned result can be used to generate the dispute flow UI using the Wise's open-source Dynamic Flows framework . The Dynamic Flows Framework will generate UI according to the received JSON and will handle the rest of the multi-step dispute submission including the generation of the subsequent pages (if needed) and the actual submission of the dispute and all the relevant documents.
An example of using a Dispute flow can be found here.
Scheme (VISA
, MASTERCARD
)
One of the reasons returned by /reasons
endpoint
ID of the transaction to dispute
Because the calls to the above endpoint are authorised they cannot be made from the Dynamic Flows JavaScript framework directly (from the browser), but instead must be proxied by the partner with the added auth headers. Therefore, a partner is expected to implement 2 additional internal endpoints:
1. Get Dynamic Form Page:
GET https://{{yourApiUrl}}/v3/spend/profiles/{{profileId}}/dispute-form/flows/step/{{scheme}}/{{reason}}?transactionId={{transactionId}}
The implementation of this endpoint is expected to redirect the call to:
POST https://api.sandbox.transferwise.tech/v3/spend/profiles/{{profileId}}/dispute-form/flows/step/{{scheme}}/{{reason}}
This implementation is also expected to add an email of the disputer and the ID of the disputed transaction. The email is added in order to allow direct communication with a person who knows the dispute details. The body of the POST
request forwarded to Wise should be of the following form:
{"email": "abc@def.com","transactionId": "<transaction id>"}
2. Post Dynamic Form Results:
The final step of the dispute flow will have to submit all the collected data to Wise. However, since Authorization
header is required, a partner is expected to implement the following endpoint (please note the absence of a step
in the URL path):
POST https://{{yourApiUrl}}/v3/spend/profiles/{{profileId}}/dispute-form/flows/{{scheme}}/{{reason}}
The request body will be generated by Dynamic Forms. The implementation of this endpoint is expected to redirect the call to:
POST https://api.sandbox.transferwise.tech/v3/spend/profiles/{{profileId}}/dispute-form/flows/{{scheme}}/{{reason}}
The response to this last call of the dynamic flow will include x-df-exit: true
HTTP header. This header is used by the JavaScript framework to add an option to exit the dynamic flow and redirect the user to a different page (or exit a WebView depending on the client's implementation). In order to intercept the last page response on the frontend onClose
function should be added to JavaScript, for example:
const onClose = () => {console.log("DF is exiting");window.location.href = "https://www.google.com/";};
Both endpoints are expected to proxy the requests with the added auth headers. In order to redirect the Dynamic Flows JavaScript library to your domain please use baseUrl
or fetcher
as part of the dynamic flows setup.
The Dynamic Form CSS styles can be overriden. An example of a Dispute flow with custom CSS can be found here.
curl -X GET 'https://api.sandbox.transferwise.tech/v3/spend/profiles/{{profileId}}/dispute-form/flows/{{scheme}}/{{reason}}?transactionId={{transactionId}}' \-H 'Authorization: Bearer <your api token>'
{"key": "TROUBLE_WITH_GOODS_SERVICES","type": "form","title": "There's a problem with the goods or service I ordered","actions": [],"schemas": [],"layout": [{"type": "decision","options": [{"title": "I never got the goods or service I ordered","action": {"url": "/v3/spend/profiles/12345/dispute-form/flows/visa/no-goods-or-services?transactionId=6789","method": "GET"},"disabled": false,"description": "Choose this if the order was cancelled or never arrived"},{"title": "Something is wrong with the goods or service I ordered","action": {"url": "/v3/spend/profiles/12345/dispute-form/flows/visa/something-wrong-what-was-received?transactionId=6789","method": "GET"},"disabled": false},{"title": "I think there might be an issue with the merchant","action": {"url": "/v3/spend/profiles/12345/dispute-form/flows/visa/scam?transactionId=6789","method": "GET"},"disabled": false,"description": "Choose this if you haven't heard from the merchant, or have found scam reviews"}]}]}