Refund
HTTPS POST / Server-to-Server
Payment requests and responses are encrypted using JWE
- JWE algorithm = RSA-OAEP + A256GCM
- The signature uses JWS PS256
Merchants must know how to prepare requests and process responses using JWE + JWS with exchange key.
https://demo2.2c2p.com/2C2PFrontend/PaymentAction/2.0/action
https://t.2c2p.com/PaymentAction/2.0/action
https://pgwid.2c2p.com/PaymentAction/2.0/action
Reminder
Note that refunds can only be requested for settled transactions.
Refund Request
To prepare a refund request, refer to the guidelines below.
Provided Sample Code
The following sample code demonstrates how to prepare request data, generate the JWT token with key, and send the API request.
For the JWT token, you may also refer to the sample code here.
- To prepare the data payload for the refund request, refer to the sample structure shown below. You may also check the API specifications here: Refund Request Parameters
2.To generate encrypted request data, refer to this guide: Generate JWT Request with Keys
<PaymentProcessRequest>
<version>3.8</version>
<merchantID>JT07</merchantID>
<invoiceNo>260121085327</invoiceNo>
<actionAmount>25.00</actionAmount>
<processType>R</processType>
</PaymentProcessRequest>
eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.ZXlKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V5TlRaSFEwMGlmUS5nVUJteDdNSHd6MmZSVmRCV0lfdTlaN0dlMzZub2NpUkp6OTFYRXdvdWJPLThucU1tV3N1TXA1TzdNNENQMG4ydHFfcEZFbEluRzE2ZnNfdUxLT3JuLXhiWmw3M3M4RmJoOVZsSVY4ZGZlUXQzSU5CWDJrak1uZ0x3c21xSmwyX3lIc19YTDVKSW1iWXIyYmlTdGtVOEhsc21MQ1FQanM1c0xVem9kbW96R0ZUU01xX0dXSEs1TDROSjdERG9NOERxb29hTE9zVlZldW51akZ4SUVFb3lhc1lUXzlQT0dvSnllY29KRnhxMU9EeGJ5Ni0yVUlqZzFOLVUtNXRGQlprbE9WVTJTZmMzQTNVemtTblV4bnN1OTUybVlTbUwtc1JrMWhzVW9OQVp2V0VCeDU2cmMxX0pJWTkzVDNnZG5ZckszS0liNkw3eDhlVmNlLUxId2RWQVEuN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- To send the encrypted request via API, refer to the sample request below.
curl --location --request POST 'https://demo2.2c2p.com/2C2PFrontend/PaymentAction/2.0/action' \
--header 'Content-Type: text/plain' \
--data-raw 'eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.ZXlKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V5TlRaSFEwMGlmUS5nVUJteDdNSHd6MmZSVmRCV0lfdTlaN0dlMzZub2NpUkp6OTFYRXdvdWJPLThucU1tV3N1TXA1TzdNNENQMG4ydHFfcEZFbEluRzE2ZnNfdUxLT3JuLXhiWmw3M3M4RmJoOVZsSVY4ZGZlUXQzSU5CWDJrak1uZ0x3c21xSmwyX3lIc19YTDVKSW1iWXIyYmlTdGtVOEhsc21MQ1FQanM1c0xVem9kbW96R0ZUU01xX0dXSEs1TDROSjdERG9NOERxb29hTE9zVlZldW51akZ4SUVFb3lhc1lUXzlQT0dvSnllY29KRnhxMU9EeGJ5Ni0yVUlqZzFOLVUtNXRGQlprbE9WVTJTZmMzQTNVemtTblV4bnN1OTUybVlTbUwtc1JrMWhzVW9OQVp2V0VCeDU2cmMxX0pJWTkzVDNnZG5ZckszS0liNkw3eDhlVmNlLUxId2RWQVEuNkdxOWFfdVZjWEdLVHlVVy5kaG44OHY0MVZiY0JPSGJLekpqbkRyMGI5a1l3aUpvcEJEdS1sSVlCUW1PQUdpLTQ2UkVUVC1GcE1Wb0hkei11WW13bktGMG9VNXNWV3k4X0x4cmVvTkpSaW4zdXFMQVM3dXhXZVJpU0d6QnBRVUMtVTItOElWT05uQVFELUZyTWxLYVN2azNwaWYzMmN1a0p5MUQ4UmR1Z21WbGRzOVpiSDVYQnlmQVJhdUZTemhaLVpPNjJjc3pIR0VGVXR3OFc2WlBCalZNMEZvSEx3eGYzZ3JidUlfVW45Unh4cTdDeEhsUDU1MC02TGdlT2kyYm9YVGNxOFBidHBIbDktUFBpSDB3cC4zTUh1U2tXd1M1cktybjNXXzVrZkJ3.XPyfoC6Zh82JQ3RyIBEitxomLHTNGNkjB4pQCfhishxLK6OYa3T6gL__dHCVwITL3DY2NBOQax5KfdPLAUV9-sB57VKT_WFCPleHcVTgRARnnOc-LlJmhMgg6fX5qqP2wd3GmVyhgD1Eg--eIvT2uHOwatV2O-4zYRnnBjBOSJ1irAL-6277NUu956bmXAopKBa2WNZXJet8DJUyMG2WgvDboa07tVRwBodzmEYj665dW08R2no4Uu2PxYME_OQTaYdCwZQ5psixhOQ6UP5jW3BkmM7ANdGhMSstcwEZVpFSNL99vBTtLN4_h29-cclw5PttfzOQQ1ZdrlhCHtBa1KSYv_sJh-7SdZnajmBE58Ya3klQqL7wupHFfFYG-A0NZfLXIqeZEG6_6uklBspQ_0Fx49sXJVshtM8zvXAmqORE_4VNnd2u0d-RJL_aA-oLvV04IanupbugkWZL47sw3SkUf3ncEPZtJDua7wBf9XjArmXkfXAsF6x2FPs7wPBhPVZihJ_5PQeYb59Cp9JfzG_nTqDwtCPZeF2seLP9ukRoal6O8DbjW2SuVCuNkF4B9BAw1DNY1VLkq2jiYAyIDQ3m4ZHqxieFV7kd5TcnOIvJRDSNMkgduf9mOh2QuTjZerHOp4ttOXDMym9y4p4Glj4hmudh-YNku_JNeQNpEr4'
Refund Response
To receive and process refund request responses, refer to the sample code below.
Provided Sample Code
The following sample code demonstrates how to receive response data and decrypt the JWT token with key.
For decrypting the JWT token, you may also refer to the sample code here.
-
Following a refund request, the API will return encrypted response data. Refer to the sample encrypted response below.
-
To decrypt the response, refer to: Process JWT Request with Keys
-
Refer to the sample response structure below. You may also check the API specifications here: Response Parameters
eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.ZXlKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V5TlRaSFEwMGlmUS5RTFNwa0duNFlqTGE4T2tSS29ZN3VLNFZZNUMtdVBNR0RKRlRIVXd5SGlTYWYxOFE0RjZLcjhrLUxyYTlMR0JZQ0ZuRkVObVNlNUtyWTNvREVjWGF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TRyRmNqb1pQTDloQjZIYzBLdw.L1ZPZscfm34DocGdIp3ksJUIZqz0g7Nc2xcFe1MpwwfS3eh3atuyOyBP0KzTekJc_7iPKqlGfJ2VEU3ppIggAC6RG4Z0zj36e2fOailBr76zFf4Xig9AFUc5M6m3xKE_Tk5HlIcM4LfiByAOYuNM52JYW-mXt9KR6M3i6QFmvuiB-jKvaUYri-X5gnRowSOeOzGAiY9BLesvLu4dm1Xo_RLm9fUQ7oXRrsdGcYC48D6FCoTjPXdeySrtElHDeJrid0R4GxNlOknMqxppWFboSRHf42yU0wen9cqt7CXNBG1bKptOlNCOAgJr1aWa2z2fYpsPn0IrzUIZ2qZRmb6O_Q
<PaymentProcessResponse>
<version>3.8</version>
<timeStamp>250221155131</timeStamp>
<respCode>00</respCode>
<respDesc>Success</respDesc>
<processType>R</processType>
<invoiceNo>260121085327</invoiceNo>
<amount>25.00</amount>
<status>RF</status>
<approvalCode>2508513089</approvalCode>
<referenceNo>3528643</referenceNo>
<refundReferenceNo>3598743</refundReferenceNo>
<transactionDateTime>20210126085854</transactionDateTime>
<maskedPan>411111XXXXXX1111</maskedPan>
<eci>05</eci>
<paymentScheme>VI</paymentScheme>
<processBy>VI</processBy>
</PaymentProcessResponse>
Refund Notification
For certain 123 payments and wallets, the refund process is asynchronous. In these cases, the initial response will be REFUND_PENDING. You will need to either repeatedly call the Refund Status Inquiry API or include a notifyURL in the refund request.
Once the refund is completed, 2C2P will send the final refund status in the HTTP POST body, encrypted with JWE + JWS.
notifyResponse=eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.ZXlKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V5TlRaSFEwMGlmUS5RTFNwa0duNFlqTGE4T2tSS29ZN3VLNFZZNUMtdVBNR0RKRlRIVXd5SGlTYWYxOFE0RjZLcjhrLUxyYTlMR0JZQ0ZuRkVObVNlNUtyWTNvREVjWGF1bjg2QXlUT0tvLXZtZWxBMkhOQWJJd2Yyb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m34DocGdIp3ksJUIZqz0g7Nc2xcFe1MpwwfS3eh3atuyOyBP0KzTekJc_7iPKqlGfJ2VEU3ppIggAC6RG4Z0zj36e2fOailBr76zFf4Xig9AFUc5M6m3xKE_Tk5HlIcM4LfiByAOYuNM52JYW-mXt9KR6M3i6QFmvuiB-jKvaUYri-X5gnRowSOeOzGAiY9BLesvLu4dm1Xo_RLm9fUQ7oXRrsdGcYC48D6FCoTjPXdeySrtElHDeJrid0R4GxNlOknMqxppWFboSRHf42yU0wen9cqt7CXNBG1bKptOlNCOAgJr1aWa2z2fYpsPn0IrzUIZ2qZRmb6O_Q
<PaymentProcessResponse>
<version>3.8</version>
<timeStamp>250221155131</timeStamp>
<respCode>00</respCode>
<respDesc>Success</respDesc>
<processType>R</processType>
<invoiceNo>260121085327</invoiceNo>
<amount>25.00</amount>
<status>RF</status>
<approvalCode>2508513089</approvalCode>
<referenceNo>3528643</referenceNo>
<refundReferenceNo>3598743</refundReferenceNo>
<transactionDateTime>20210126085854</transactionDateTime>
<maskedPan>411111XXXXXX1111</maskedPan>
<eci>05</eci>
<paymentScheme>VI</paymentScheme>
<processBy>VI</processBy>
</PaymentProcessResponse>
Updated 13 days ago