Payoneer payments using REST API Integration via SAP PO with REST Adapter
Payoneer payments using REST API Integration via SAP PO with REST Adapter
Payoneer is a payment solution for disbursing funds to payees globally. Payoneer offers REST APIs through which customers and partners can implement integration to Payoneer for various financial interfaces. This blog is to provide a guide on how to implement integration with these REST APIs from Payoneer using SAP PI/PO middleware.
Prerequisites: Account on Payoneer’s Sandbox system.
Payoneer Sandbox URL: https://api.sandbox.payoneer.com
Business Scenario – Payment Submission
The payment is sent from SAP ECC system using an ABAP Proxy to Payoneer via REST. This is a synchronous scenario. The trigger for the ABAP proxy happens when the approver approves the payment in SAP ECC and the payment is released. The payment gets created, an output type is triggered which makes the ABAP Proxy call to SAP PO 7.31 by passing the payment details as an input. This call is forwarded to Payoneer to make the payments, by calling the “POST” operation. After the payment details are posted into Payoneer system, a response with the payment descriptions is returned towards SAP PO 7.31 and this is mapped towards the SAP ECC system. Once the response is received within the ABAP Proxy, this updates the financial statements by calling the necessary function module.
Synchronous Communication between SAP ECC and Payoneer via SAP PO.
Implementation
While developing Restful Synchronous scenario, Payoneer had provided the request and response message structure which was in JSON format.
REQUEST MESSAGE STRUCTURE:
curl -X POST
https://api.sandbox.payoneer.com/v2/programs/{program_id}/payouts
-H “Content-Type: application/json”
–d {
“payee_id”: “TEST123”,
“amount”: “5.10”,
“client_reference_id”: “Payment12”,
“description”: “Test Payment”,
“payout_date”: “2017-10-25”,
“currency”: “USD”,
“group_id”: “123”
}
Sample Request to Payoneer’s REST API
Below XSD structure for request message was created with an external tool and imported into SAP PO 7.31.
During initial setup of integration with Payoneer, they will provide the unique Program_ID and credentials created for your client.
RESPONSE MESSAGE STRUCTURE:
{
“audit_id”: 3988688,
“code”: 0,
“description”: “Success”,
“payout_id”: “8703789” }
Sample Response to Payoneer’s REST API
Below XSD structure for response message was created with an external tool and imported into SAP PO 7.31.
As request and response messages are in JSON message format, I have converted them in REST receiver adapter settings.
Configuration
Sender Channel: ABAP Proxy
Receiver Channel: SAP REST Adapter
- General Tab settings:
- REST URL tab: During initial setup of integration with Payoneer, they will provide the unique Program_ID for your client which you can provide in the target URL of REST receiver adapter.
https://api.sandbox.payoneer.com/v2/programs/{program_id}/payouts
Payoneer REST API’s are HTTPs complaint. You can download the certificate over the browser and upload into NWA.
- REST operation Tab: The CRUD operation is POST
- DATA FORMAT tab: The message format to be requested and response both are in JSON format so we need to convert the XML message to JSON.
- HTTP Header Tab: In header we need to send Content-type : application/json
There are 2 ways to achieve:
a. Under HTTP Header Tab
b. Under Module Tab:
Module: “AF_Modules/MessageTransformBean” and
Parameter: Transform.ContentType, application/json
Header Authorization: For authentication we need to send Credentials over HTTP header which we can set up in HTTP HEADERS tab:
The credential is encoded with Base64.
- Error Handling Tab:
However, SAP REST Adapter is released with PO 7.31 SP14, I faced lot of challenges in case of handling non-200 HTTP status code.
Client’s PO version: 7.31, SP16
In case of HTTP status code: 200, response was received and sent to ECC system properly.
But in case of non-200, there was no option to get the response as-is into PO system.
So, I decided to go for customized error handling option and I configured like below:
- {http_result}: In any case the content of the response was needed so, I used {http_result} to bring the content.
- {http_status}: Provides the HTTP returned code.
- {http_status_result}: Text of the HTTP returned status. Ex: Bad Request.
And later you can handle the message in response mapping.
Conclusion
This is a unique article, since there isn’t any existing documentation or implementation with Payoneer integration via the SAP PI/PO/PRO middleware. Like Payment submission Payoneer offers multiple services and you can integrate using similar approach.This article has been explicit in providing a guide on how achieve integration with Payoneer.
Have a happy Integration with REST!
Thanks.Kumari .much needed Info.
Regards,
BhaskarBusi
Your welcome!
Regards,
Aarti Kumari
Hi Aarti,
Thanks for sharing this.
My rek is also look like same. File will pick by PI from ECC and via Receiver REST Adapter it has to upload the file in sharefile folder.
SAP ECC ->PI/PO ->Sharefile API
Sharefie is 3rd party api and it uses Oauth2.0
To upload: https://account.sf-api.com/sf/v3/Shares(id)/Upload, where id will be provided by client.
I have some queries like
5. In Module tab, shall i have to mentioned exactly what you have mentioned?
I am new in PI, this is my 1st assignment. Please, guide me how to proceed further.
Regards,
Binod
I also want received the above payments through payoneer but until now I didn't get anything so how could you help me?