{"swagger":"2.0","info":{"version":"1.0.0","title":"2c2p API Docs","description":"A Demo API to 2c2p Payment Service."},"tags":[{"name":"Payment","description":"Return PaymentToken"},{"name":"DoPayment","description":"Retrun redirect url","externalDocs":{"description":"Find out more","url":"https://developer.2c2p.com/docs/api-do-payment"}},{"name":"Inquiry","description":"Return encrypted request data","externalDocs":{"description":"Find out more","url":"https://developer.2c2p.com/docs/payment-maintenance-inquiry-guide"}}],"paths":{"/payment/4.1/PaymentToken":{"post":{"tags":["Payment"],"summary":"Return paymentToken by payload","description":"Refer to payload request data","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/PaymentToken"}}],"responses":{"200":{"description":"Ok","examples":{"application/json":{"webPaymentUrl":"https://sandbox-pgw-ui.2c2p.com/payment/4.1/#/token/kSAops9Zwhos8hSTSeLTUcCrwcnrndJUZanGJy3fBEsXCiYmynwxHvK5h7XPBadJqD0nG7v65t5N2jPVrnwX2jL4nu%2bKKSegjUjERKCyWPg%3d","paymentToken":"kSAops9Zwhos8hSTSeLTUcCrwcnrndJUZanGJy3fBEsXCiYmynwxHvK5h7XPBadJqD0nG7v65t5N2jPVrnwX2jL4nu+KKSegjUjERKCyWPg=","respCode":"0000","respDesc":"Success"}},"schema":{"$ref":"#/definitions/PaymentTokenResponse"}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"},"500":{"description":"Server Error"}}}},"/payment/4.1/payment":{"post":{"tags":["Payment"],"summary":"Return redirect url","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/DoPayment"}}],"responses":{"200":{"description":"Ok","examples":{"application/json":{"channelCode":"ALIPAY","data":"https://api.2c2p.com/pgw/authenticate/e5d8d1ed-2684-48b2-a7b6-d36fbc4fa5c2","respCode":"1000","respDesc":"Redirect to authenticate ACS bank page."}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"},"500":{"description":"Server Error"}}}},"/PaymentAction/2.0/action":{"post":{"tags":["Inquiry"],"summary":"Return encrypted request data","consumes":["text/plain; charset=utf-8"],"produces":["text/plain; charset=utf-8"],"parameters":[{"in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/Inquiry"}}],"responses":{"200":{"description":"Ok","schema":{"$ref":"#/definitions/InquiryResponse"}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"},"500":{"description":"Server Error"}}}}},"definitions":{"Payload":{"type":"object","required":["merchantID","invoiceNo","description","amount","currencyCode"],"properties":{"merchantID":{"type":"string","example":702702000001670,"description":"Unique merchant ID that is registered with 2C2P"},"invoiceNo":{"type":"string","example":"SGD57282867","description":"Unique merchant order number"},"description":{"type":"string","example":"dogedogedoge","description":"Product description"},"amount":{"type":"number","format":"double","example":"50.0"},"currencyCode":{"type":"string","example":"SGD","description":"Transaction currency code in 3 alphabetical values as specified in ISO 4217"},"paymentChannel":{"type":"array","items":{"type":"string"},"example":["ALIPAY"],"description":"Payment channel required to enable"}}},"PaymentToken":{"type":"object","required":["payload"],"properties":{"payload":{"type":"string","description":"Return PaymentToken to payload response"}}},"DoPayment":{"type":"object","required":["paymentToken","payment","code","channelCode","data"],"properties":{"paymentToken":{"type":"string","description":"Payment token ID","example":"kSAops9Zwhos8hSTSeLTUd3k4olUg6PfGpkuP8WYmsgCS6jIrJ70E9UHc+SJnWR0WxkkJhWGA49svPdhZCPYWBiPiaT5f01l+7L44VbGiebp+2hg7P7dT01euDuHVPSy"},"clientID":{"type":"string","description":"Unique client ID","example":"E380BEC2BFD727A4B6845133519F3AD7"},"locale":{"type":"string","description":"Api response localization","example":"en"},"responseReturnUrl":{"type":"string","description":"Payment response return URL","example":"https://pgw.2c2p.com/ui/4.1/info"},"payment":{"type":"object","properties":{"code":{"type":"object","description":"Payment code information","properties":{"channelCode":{"type":"string","description":"Payment channel code","example":"ALIPAY"},"agentCode":{"type":"string","description":"Agent's code","example":"SCB"},"agentChannelCode":{"type":"string","description":"Agent's channel code","example":"ATM"}}},"data":{"type":"object","description":"Payment data","properties":{"name":{"type":"string","description":"Customer’s name","example":"tester"},"mobileNo":{"type":"string","description":"Customer’s mobile number","example":"0888888888"},"accoutNo":{"type":"string","description":"Customer’s account number","example":"0898989898"},"securePayToken":{"type":"string","description":"SecurePay encrypted token.A token generated by SecurePay SDK"},"email":{"type":"string","description":"Customer's email","example":"tester@2c2p.com"}}}}}}},"Inquiry":{"type":"string"},"PaymentTokenResponse":{"type":"object","properties":{"payload":{"type":"string"}}},"DoPaymentResponse":{"type":"object","properties":{"channelCode":{"type":"string"},"data":{"type":"string"},"respCode":{"type":"string"},"respDesc":{"type":"string"}}},"InquiryResponse":{"type":"string"}},"host":"sandbox-pgw.2c2p.com","schemes":["https"]}