17-03-22 06:23 AM
Hi all,
I am looking for help with using POST method in Web API Services with Single File to perform the Mastercard API below.
How should I include the rest of the required details in the Body (ie amount, chargebackType, etc)?
Common Header: Content-Type has value application/json
Request Body Content: Single File
File Parameter Name: File
I have also loaded the pdf file into a binary data type (File) in blue prism using the function LoadBinaryFile()
API Documentation link:
https://developer.mastercard.com/mastercom/documentation/api-reference/v6-reference/
Request URL:
https://api.mastercard.com/mastercom/v6/claims/{claim-id}/chargebacks
Body:
{
"amount": "100.00",
"chargebackType": "CHARGEBACK",
"currency": "USD",
"documentIndicator": "true",
"reasonCode": "4853",
"credPostedAsPurchase": false,
"isPartialChargeback": false,
"messageText": "This is a test message text",
"settlementDate": "2021-09-22",
"localTax1IVA": "0.60",
"installmentFee": 1.2,
"editExclusionCode": "BO",
"refundNotReceivedIndicator": "true",
"includeCurrencyConversionAssessmentCCA": "true",
"fileAttachment": {
"filename": "testimage111111.pdf",
"file": "This is an image file stored in a base64 encoded string"
}
}
17-03-22 07:49 AM
29-04-22 04:41 PM
Hi Jian,
Yes as Shashank said you will need to include the file as a BASE 64 encoded file. If you look at the Model tab of the call this is the description mastercard give.
fileAttachment | DocumentStructure |
CONDITIONAL: Unless specified as REQUIRED, fileAttachment object is OPTIONAL. When fileAttachment is provided, then fileName and file parameters are required. The base64 encoded string must represent a ZIP, JPG, TIFF, or PDF file. Please note: ZIP files may contain JPG, TIFF or PDF files. |