The Console API is available on your stage interface as well as on your production interface via the following URLs.
- Stage: https://stage-console.hipay.
com/api/docs - Production: https://console.hipay.com/
api/docs
First, you need to generate a recurring export via HiPay Console.
Please remember to:
|
Generating a temporary key
In the first place, generate a token (temporary key) to sign in by using the following URLs.
- Stage: https://stage-console.hipay.
com/api/docs - Production: https://console.hipay.com/api/docs
- Click on the POST /api/login endpoint.
- Click on the "Try it out" button.
- Click on the EXAMPLE VALUE | MODEL area and change the following information:
- In the field "username": "string", enter your login email address to sign in to HiPay Console in quotation marks instead of "string".
- In the field "password": "string", enter your password in quotation marks instead of "string" (be careful: your password will be displayed, please make sure to be alone before entering it).
- Click on the "Execute" button.
- Your token has been generated. It is available in the "Response body" area with a black background.
- Select this token by selecting the lines in quotation marks.
- Copy the token (Ctrl+C on a PC or Cmd+C on a Mac).
Example:
{ "token": "[YOUR TOKEN]" }
Retrieving recurring export files via the API
Now that your token is stored on your computer, access the https://console.hipay.com/
- Click on the "Authorize" button.
- Enter your token in the "Value" field (Ctrl+V on a PC or Cmd+V on a Mac), preceded by Bearer [space].
- Click on "Authorize".
- The "Available authorizations" window confirms your access.
- Close the window by clicking on the cross at the top right.
GET / api/exports enables you to list recurring exports.
- Click on "Try it out" to retrieve the list.
- Click on "Execute".
- A JSON table is displayed in the "Response Body" area.
Example:
[ { "exportId": 139, "dateCreated": "2019-11-20T09:45:10+01:00", "exportFiles": [
{
"fileId": 227,
"dateCreated": "2020-01-16T01:00:02+01:00",
"filename": "EVERY_ACCOUNT_20200116-010002",
"hash": "0e5c31c4c5b1a0d93f4fa2c04a098526609b58782831b986864ecfffe11cd4be710e701b25463faad33c908567b36d752c39e369692405b7e641cde7ffe4d003",
"status": "sent",
"nbItems": 244
}, ], "filePrefix": "EVERY_ACCOUNT", "emails": "[YOUR EMAIL]", "module": "transaction", "columns": "{\"merchant_order_id\":\"Order ID\",\"sentinel_result\":\"Sentinel status\",\"card_country\":\"Card Country\",\"sentinel_score\":\"Score\",\"auth\":\"Auth status\",\"auth_method\":\"Authentication method\",\"payment_means\":\"Payment means\",\"amount\":\"Authorized amount\",\"trxid\":\"Transaction ID\",\"status\":\"Current transaction status\",\"balance\":\"Remaining balance\",\"order_currency\":\"Currency\",\"custom_data\":\"Custom data\",\"tpe_reference\":\"TPE ref.\",\"operation_date\":\"Operation\",\"operation_amount\":\"Payment operation amount\",\"operation_status\":\"Payment operation status\"}","
"filters": "{\"size\":\"-1\",\"order_by\":\"created_date\",\"direction\":\"desc\",\"card_country\":\"FR\",\"authorized_by_payment_means_date_to\":\"2020-01-31\",\"authorized_by_payment_means_date_interval\":\"cd\",\"authorized_by_payment_means_date_from\":\"2020-01-31\"}", "urlFilters": "?fp_authorized_by_payment_means_date_from=2019-11-20&fp_authorized_by_payment_means_date_interval=cd&fp_authorized_by_payment_means_date_to=2019-11-20&fp_card_country=FR", "separator": "comma", "recurrence": "daily", "receiveByEmail": true,
"recurrenceDay": null,
"nbOccurrence": 10,
"endRecurrenceDay": null,
"userId": 123,
"config": null } ]
- The "exportId" field provides the unique reference of your exports.
- The "exportFiles" field enables you to know the reference of one or several export files already generated.
To retrieve the file, you first need to retrieve the encrypted security hash by using the GET/api/exports/[export ID]/files endpoint.
- Click on "Try it out".
- Fill out the Export ID field: (for the example) 139.
- Click on the "Execute" button.
- A JSON table is displayed in the "Response Body" area.
Example:
[ { "fileId": 227, "dateCreated": "2020-01-16T01:00:02+01:00", "filename": "EVERY_ACCOUNT_20200116-010002", "hash": "0e5c31c4c5b1a0d93f4fa2c04a098526609b58782831b986864ecfffe11cd4be710e701b25463faad33c908567b36d752c39e369692405b7e641cde7ffe4d003"
"status": "active",
"nbItems": 123, }
]
- The "fileId" field provides the unique reference of your files.
- The "hash" field enables you to download the file.
To download the file, please use the GET/api/export-files/[File ID] endpoint.
- Click on "Try it out".
- Fill out the Export file ID field: (for the example) 227.
- Fill out the Export file secured hash field: (for the example) 0e5c31c4c5b1a0d93f4fa2c04a098526609b58782831b986864ecfffe11cd4be710e701b25463faad33c908567b36d752c39e369692405b7e641cde7ffe4d003
- Click on the "Execute" button.
WARNING: The file is not downloaded, but you get a curl example which enables you to download the file on your workstation thanks to your terminal.
curl -X GET "https://console.hipay.com/api/export-files/227?hash=0e5c31c4c5b1a0d93f4fa2c04a098526609b58782831b986864ecfffe11cd4be710e701b25463faad33c908567b36d752c39e369692405b7e641cde7ffe4d003" -H "accept: application/zip" -H "X-Authorization: Bearer [MY TOKEN]" --output [TARGET FOLDER]
PLEASE NOTE Files are available for download:
|
Customizing your export
To customize some of your exports data, use the PUT/api/exports/[Export ID] endpoint.
Example:
{ "filePrefix": "EVERY_ACCOUNT", "columns": "{\"merchant_order_id\":\"Order ID\",\"sentinel_result\":\"Sentinel status\",\"card_country\":\"Card country\",\"sentinel_score\":\"Score\",\"auth\":\"Auth status\",\"auth_method\":\"Authentication method\",\"payment_means\":\"Payment means\",\"amount\":\"Authorized amount\",\"trxid\":\"Transaction ID\",\"status\":\"Current transaction status\",\"balance\":\"Remaining balance\",\"order_currency\":\"Currency\",\"custom_data\":\"Custom data\",\"tpe_reference\":\"TPE ref.\",\"operation_date\":\"Operation\",\"operation_amount\":\"Payment operation amount\",\"operation_status\":\"Payment operation status\"}", "separator": "comma", "recurrence": "daily", "receiveByEmail": true
"recurrenceDay": null,
"nbOccurrence": 1,
"endRecurrenceDay": null
"dateUpdated": 2021-04-23 12:00:00+02
"status": "active",
"config": { "granularity": "transaction" } }
Here are the customizable fields:
- the "filePrefix" file name,
- the "columns" names. This is a JSON field, only the label can be customized.
- Example: For "merchant_order_id\":\"Order ID\", you can edit the name of the column as "merchant_order_id\":\"ORDER\".
PLEASE NOTE By default, the titles of the columns ("columns" fields) are in the preferred language of your HiPay Console interface. |
- Possible values for the "separator":
- comma
- semicolon
- Possible values for the export "recurrence":
- once
- daily
- weekly
- monthly
- Possible values for the reception by email "receiveByEmail":
- true: you will receive the export by email
- false: you will not receive an email
- Configuration: “config” is a (JSON) object enabling you to change the format of your export. The possible values are:
- granularity: “transaction” or “operation” for a view by transaction or by payment operation. If this option is not specified, the default view for the export is the view by transaction (transaction module export ONLY).
Related articles:
Comments
0 comments
Article is closed for comments.