Edenred Direct Payment Services
Use Case: Romania
1. Generalities
In Romania, with the Ticket Restaurant Card, a user can spend the amount requested without any limitation (in the limit of the balance available on his account), i.e. balance canβt be negative.
The regulation(s) are handled on the Edenred side. Please note that all amounts in our API are given in cents (example: 9RON = 900
).
2. User Security Tokens
Please refer to this section for more details about security tokens.
2.1. Login Process
Edenred Connect v4 Url:
Example of account that can be used to test the API:
Username: erro-edps03@edenred.com
Password: Edenred2021*
PAN: 2937
2.2. Logout Process
Logout the Edenred account from your platform. All tokens are then invalid
GET /connect/endsession?id_token_hint=<idToken>=<postLogoutRedirectUri> HTTP/1.1
Host: {{authentication-URL}}
Where
'authentication-url' = sso.sbx.edenred.io
And idToken
is retrieved from the refreshing token response
And postLogoutRedirectUri
is a callback URL whitelisted on our side (to be provided in the configuration request)
eg: postLogoutRedirectUri = http://nowhere.edenred.net/oauth/callback
3. Direct Payment API
3.1. Postman Collection
Postman Collection Link:
3.2. User Balance
Get Balances
Gets all the available user vouchers including the full sum of their values.
The authorization header is mandatory for this request.
Request:
GET /v2/users/{username}/balances HTTP/1.1
Host: directpayment.stg.eu.edenred.io
Authorization: Bearer {token}
X-Client-Id: {payment-clientId}
X-Client-Secret: {payment-clientSecret}
Response:
{
"meta": {
"status": "succeeded",
"messages": []
},
"data": [
{
"available_amount": 305418,
"currency": "RON"
}
]
}
Estimate Charge
Check if an amount can be spent and answer the possible amount that can be spent. If the requested amount is above the available balance, the service will provide the available amount in the response.
The authorization header is mandatory for this request.
Request:
POST /v2/users/{username}/actions/estimate-charge HTTP/1.1
Host: directpayment.stg.eu.edenred.io
Authorization: Bearer {token}
X-Client-Id: {payment-clientId}
X-Client-Secret: {payment-clientSecret}
Content-Type: application/json
{
"amount": 1900
}
Response:
{
"meta": {
"status": "succeeded",
"messages": []
},
"data": {
"available_amount": 1500,
"currency": "RON"
}
}
3.3. User Transactions
Capture Mode: Auto
Step 1: Auto Capture a payment
An auto capture can be requested with an amount and/or a voucher array.
The authorization header should be set for this operation.
The field
tstamp
MUST be set in order to manage idempotency
Request:
POST /v2/transactions HTTP/1.1
Host: directpayment.stg.eu.edenred.io
Authorization: Bearer {token}
X-Client-Id: {payment-clientId}
X-Client-Secret: {payment-clientSecret}
Content-Type: application/json
{
"order_ref": "order-002",
"mid": "00176631098",
"amount": 1,
"currency": "RON",
"capture_mode": "auto",
"extra_field": "order-002",
"tstamp": "2019-05-23T14:02:50Z"
}
Response:
{
"meta": {
"status": "succeeded",
"messages": []
}
"data": {
"order_ref": "order-002",
"mid": "00176631098",
"authorization_id": "455211",
"authorized_amount": 1,
"capture_id": "455211",
"capture_amount": 1,
"status": "captured"
}
}
Step 2: Refund a captured payment
Once captured, a transaction can't be cancelled but have to be refunded.
The authorization_id provided during the payment process must be provided in this request.
The authorization header should not be set for this operation.
The field
tstamp
MUST be set in order to manage idempotency
Refund Request:
POST /v2/transactions/{authorization_id}/actions/refund HTTP/1.1
Host: directpayment.stg.eu.edenred.io
X-Client-Id: {payment-clientId}
X-Client-Secret: {payment-clientSecret}
Content-Type: application/json
{
"amount": 1,
"currency": "RON",
"tstamp": "2019-05-23T14:02:50Z"
}
Refund Response:
{
"meta": {
"status": "succeeded",
"messages": []
},
"data": {
"refund_id": "786653",
"refunded_amount": 1,
"status": "refunded"
}
}
3.4. Get transactions
Please refer to this section for more details about this API.
3.5. Get transaction by ID
Please refer to this section for more details about this API.
4. Error Codes
Status Code | Status | Code | Level | Description |
---|---|---|---|---|
200 | succeded | OK | Success | OK |
200 | succeded | AUTH | Success | The transaction has been authorized. |
200 | succeded | AUTH_PENDING | Success | The transaction authorization is pending. |
200 | succeded | PARTIAL_AUTH | Success | The transaction has been partially authorized. |
400 | failed | INVALID_CARD | Error | INVALID CARD SERIAL NUMBER |
400 | failed | CARDHOLDER_ALREADY_EXISTS | Error | CARDHOLDER ALREADY EXISTS |
400 | failed | REFERENCE_ALREADY_EXISTS | Error | REFERENCE ALREADY EXISTS |
400 | failed | INVALID_ACTIVATION_CODE | Error | INVALID ACTIVATION CODE |
400 | failed | INVALID_ACCOUNT | Error | INVALID ACCOUNT NUMBER |
400 | failed | BAD_REQUEST | Error | INVALID DATE RANGE |
400 | failed | BAD_REQUEST | Error | INVALID PAGE OFFSET |
400 | failed | BAD_REQUEST | Error | DATE FROM TOO OLD |
400 | failed | INVALID_CARDHOLDER | Error | INVALID CARDHOLDER |
400 | failed | INVALID_EMAIL | Error | INVALID EMAIL |
400 | failed | INVALID_PHONE | Error | INVALID PHONE |
400 | failed | NON_UNIQUE_MOBILE_NUMBER | Error | NON-UNIQUE MOBILE NUMBER |
400 | failed | CARD_NOT_BLOCKED | Error | CANNOT RESUME(Card not blocked or already blocked) |
400 | failed | CARD_ALREADY_REGISTERED | Error | CARD ALREADY REGISTERED |
400 | failed | REGISTRATION_NOT_ALLOWED | Error | REGISTRATION NOT ALLOWED |
400 | failed | DUPLICATE_CARDHOLDER | Error | DUPLICATE CARDHOLDER |
400 | failed | CARD_BLOCKED | Error | Card is not in valid state |
400 | failed | BAD_REQUEST | Error | PIN REQUIRED |
400 | failed | CARDHOLDER_STATUS_INVALID | Error | CARDHOLDER STATUS INVALID |
400 | failed | CARD_BLOCKED | Error | CARD/ACCOUNT BLOCKED |
400 | failed | BAD_REQUEST | Error | INVALID PRODUCT BALANCE |
400 | failed | BAD_REQUEST | Error | INVALID ACCOUNT EXTERNAL REFERENCE |
400 | failed | BAD_REQUEST | Error | PIN ERROR |
400 | failed | BAD_REQUEST | Error | PIN LOCKED |
400 | failed | BAD_REQUEST | Error | PIN STATUS NOT BLOCKED |
400 | failed | BAD_REQUEST | Error | CARD NOT FULFILLED |
400 | failed | CARD_ALREADY_ACTIVATED | Error | Card is already activated |
400 | failed | BAD_REQUEST | Error | PIN STATUS NOT ACTIVE ACTIVATING |
400 | failed | BAD_REQUEST | Error | MAX PIN TRIES EXCEEDED |
400 | failed | BAD_REQUEST | Error | CARD NOT ACTIVE |
400 | failed | INVALID_MERCHANT | Error | Invalid Merchant |
400 | failed | INVALID_AMOUNT | Error | INSUFFICIENT FUNDS |
400 | failed | INVALID_AMOUNT | Error | Invalid Amount |
400 | failed | DECLINED | Error | Declined |
400 | failed | TRANSACTION_DUPLICATED | Error | Transaction Duplicated |
400 | failed | LIMIT_EXCEEDED | Error | Limit exceeded |
400 | failed | PARTIAL_REVERSALS_NOT_ALLOWED | Error | Partial resversals not allowed |
400 | failed | INVALID_VOUCHER | Error | Invalid Voucher |
400 | failed | LOCKOUT | Error | lockout |
400 | failed | TEMPORARY_HOLD | Error | Temporary hold |
400 | failed | PARTIAL_AUTH_NOT_SUPPORTED | Error | Partial authorization not supported |
400 | failed | CARD_NOT_ACTIVATED | Error | Card is not activated |
400 | failed | CARD_BLOCKED | Error | Card blocked |
400 | failed | INVALID_ACCOUNT | Error | Invalid account |
400 | failed | INCORRECT_PIN | Error | Incorrect PIN |
400 | failed | ACCOUNT_BLOCKED | Error | Account blocked |
400 | failed | INVALID_CURRENCY_CODE | Error | Invalid currency |
400 | failed | INVALID_CARD | Error | Invalid card |
400 | failed | TOPTP_VALIDATION_FAILED | Error | toptp validation failed |
400 | failed | INVALID_TRANSACTION_TYPE | Error | Invalid transaction type |
400 | failed | INVALID_CAPTURE_MODE | Error | You are not allowed to capture transaction |
400 | failed | INVALID_VERIFICATION_CODE | Error | The verification code is invalid |
400 | failed | CARD_NOT_REGISTERED | Error | Card not registered |
400 | failed | ACCOUNT_ALREADY_ACTIVATED | Error | User already activated |
400 | failed | INVALID_EMAIL | Error | Email already registered |
400 | failed | INVALID_TOKEN | Error | Wrong token |
400 | failed | EXPIRED_TOKEN | Error | Expired link |
400 | failed | OTHER_REGISTERED_CARDS | Error | Account cannot be deleted because there are other registered cards |
400 | failed | WRONG_PHONE_NUMBER_FORMAT | Error | The Mobile Phone Number has an incorrect format |
400 | failed | TOO_MANY_REGISTRATION | Error | Too many account registrations for the same card |
400 | failed | WRONG_EMAIL_FORMAT | Error | Email address is invalid |
400 | failed | INVALID_CARD | Error | Invalid card information provided |
400 | failed | ACCOUNT_NOT_EXISTED | Error | Account does not exist or has been deleted |
400 | failed | IMPOSSIBLE_ASSOCIATION | Error | Card already linked |
400 | failed | WRONG_PHONE_NUMBER_FORMAT | Error | PhoneNumberWithCountryCode must begin with plus, followed by up to 3 digits, a space and 3 to 12 digits! |
400 | failed | WRONG_PHONE_NUMBER_FORMAT | Error | Phone number should have between 3 and 12 digits, without the leading zero! |
400 | failed | WRONG_PHONE_NUMBER_FORMAT | Error | Phone Country Code must have 1 to 3 digits! |
400 | failed | WRONG_PHONE_NUMBER_FORMAT | Error | The Romanian phone numbers should have 8 digits after zero! |
400 | failed | INVALID_EMAIL | Error | Specified email adress is missing from database |
400 | failed | IMPOSSIBLE_ASSOCIATION | Error | Virtual cards must use pending associations |
400 | failed | IMPOSSIBLE_ASSOCIATION | Error | Virtual Cards cannot be registered with this application! |
400 | failed | ASSOCIATION_MUST_BE_RESTARTED | Error | The card doesn't have a pending association with the current user |
400 | failed | BAD_REQUEST | Error | Please select the county |
400 | failed | INVALID_VERIFICATION_CODE | Error | The verification code is invalid. |
400 | failed | BAD_REQUEST | Error | INVALID PARAMETERS |
400 | failed | ACCOUNT_LIMIT_EXCEEDED | Error | Account has reached the maximun allowed limit |
400 | failed | INSUFFICIENT_FUNDS | Error | Insufficient funds to complete the request |
400 | failed | INACTIVE_ACCOUNT | Error | The account is not active |
400 | failed | REQUEST_DENIED | Error | Request has been rejected due to business rule |
400 | failed | DAILY_LIMIT_EXCEEDED | Error | Daily limit on trasferring funds has been reached |
400 | failed | INVALID_CUSTOMER | Error | The customer code provided was invalid |
400 | failed | INVALID_PAYMENT_REFERENCE | Error | Payment reference does not conform to the validation rules |
400 | failed | BANKING_NOT_SUPPORTED | Error | Banking is not configured for this Product Class |
400 | failed | INACTIVE_BANK_ACCOUNT | Error | The bank account is not active |
400 | failed | INVALID_PAYEE_DETAILS | Error | The payee details provided are invalid |
400 | failed | PAYEE_REFERENCE_NOT_FOUND | Error | Payee with the given reference does not exist on system |
400 | failed | BANK_ACCOUNT_RESTRICTED | Error | Banking functionality has been restricted for this card holder or this account |
400 | failed | FIXED_PERIOD_LIMIT_EXCEEDED | Error | A spend limit will be exceeded if the payment is processed |
400 | failed | BAD_REQUEST | Error | The input doesn't respect the contract expected (required fields, type, etc.) |
400 | failed | EMPTY_AUTHORIZATION_TOKEN | Error | Unable to retrieve the OpenId token from the request. Please verify your request and, if required, contact the API administrator for assistance. |
400 | failed | INVALID_SEARCH_PERIOD | Error | The search period is longer than 3 months. |
400 | failed | BAD_REQUEST | Error | The server cannot or will not process the request due to an apparent client error. Check messages field for more details. |
400 | failed | DECLINED | Error | Transaction declined. |
400 | failed | INVALID_REQUEST | Error | The configuration allows only single/dual messaging requests. |
400 | failed | CARD_NOT_ACTIVE | Error | No active card found for the username. |
400 | failed | INVALID_AMOUNT | Error | Insufficient funds or amount too small/big. |
400 | failed | INVALID_MERCHANT | Error | The merchant is not valid, please check the given mid. |
400 | failed | INVALID_VOUCHER | Error | Voucher not valid. |
400 | failed | LIMIT_EXCEEDED | Error | The amount is incorrect according your past orders. |
400 | failed | LOCKOUT | Error | Max PIN tries exceeded. |
400 | failed | PARTIAL_REVERSALS_NOT_ALLOWED | Error | Partial refunds are not allowed. |
400 | failed | TEMPORARY_HOLD | Error | Transaction temprorary hold. |
400 | failed | TRANSACTION_DUPLICATED | Error | A same transaction already exists. |
400 | failed | TRANSACTION_STATUS_MUST_BE_AUTHORIZED | Error | Invalid operation, the status of the transaction must be authorized |
400 | failed | INVALID_AMOUNT | Error | Ensure that the amount you want to cancel matches the authorized amount. |
400 | failed | TRANSACTION_NOT_AUTHORISED | Error | Transaction not authorised. |
400 | failed | TRANSACTION_STATUS_MUST_BE_CAPTURED | Error | Invalid operation, the status of the transaction must be captured |
401 | failed | UNAUTHORIZED | Error | SSL CONNECTION REQUIRED |
401 | failed | UNAUTHORIZED | Error | INVALID CREDENTIALS |
401 | failed | UNAUTHORIZED | Error | INVALID SSL CERTIFICATE |
401 | failed | BAD_CREDENTIALS | Error | Incorrect username or password or account is locked-out |
401 | failed | INVALID_TOKEN | Error | Invalid, revoked or expired token. You should try to re-authenticate the user. |
401 | failed | UNAUTHORIZED | Error | Missing, invalid or expired token. To fix, you should re-authenticate the user. |
401 | failed | USER_INACTIVE | Error | User Inactive. |
401 | failed | INVALID_TOKEN_ISSUER | Error | The token has not been issued (tokenUsername) for the current user (username) |
403 | failed | FORBIDDEN | Error | INVALID IP |
403 | failed | FORBIDDEN | Error | INVALID MAC |
403 | failed | INVALID_PASSWORD | Error | Wrong password |
403 | failed | FORBIDDEN | Error | The session has expired |
403 | failed | FORBIDDEN | Error | User not activated |
403 | failed | LAST_CARD | Error | After removing the last registered card, the account should be deleted |
403 | failed | FORBIDDEN | Error | Too many failed Add Card attempts |
403 | failed | FORBIDDEN | Error | Too many card unblock attempts |
403 | failed | FORBIDDEN | Error | Too many Reset Password attempts |
403 | failed | FORBIDDEN | Error | The request was valid, but the server is refusing action. The user might not have the necessary permissions for this resource. |
404 | failed | NOT_FOUND | Error | User not found |
404 | failed | TRANSACTION_NOT_FOUND | Error | No transaction found for the given transaction_id. |
404 | failed | ORIGIN_TRANSACTION_ID_NOT_FOUND | Error | The origin transaction_id is not found. |
404 | failed | NOT_FOUND | Error | If no transaction is linked to the transaction_id given as input. |
405 | failed | METHOD_NOT_ALLOWED | Error | A request was made of a resource using a request method not supported by that resource; for example, using GET on a form which requires data to be presented via POST, or using PUT on a read-only resource. |
405 | failed | METHOD_NOT_ALLOWED | Error | A request was made of a resource using a request method not supported by that resource. |
406 | failed | NOT_ACCEPTABLE | Error | The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request. |
409 | failed | CONFLICT | Error | The card is already linked to a beneficiary |
412 | failed | PRECONDITION_FAILED | Error | A business precondition has not been; for example, the user has no active cards. |
412 | failed | PRECONDITION_FAILED | Error | A business precondition has not been. |
415 | failed | UNSUPPORTED_MEDIA_TYPE | Error | The request entity has a media type which the server or resource does not support. |
429 | failed | TOO_MANY_REQUEST | Error | Your request has been rejected due to rate limitation. Please check your subscribed service level agreement. |
500 | failed | INVALID_POST_CODE | Error | INVALID POST CODE |
500 | failed | COMPLIANCE_DATA_NOT_ALLOWED | Error | COMPLIANCE DATA NOT ALLOWED |
500 | failed | INTERNAL_ERROR | Error | Internal Server Error |
500 | failed | CARD_EXPIRED | Error | Card expired |
500 | failed | INTERNAL_ERROR | Error | Invalid Message :Field: [value.amt] must be numeric |
500 | failed | INACTIVE_USER | Error | Inactive user |
500 | failed | INTERNAL_ERROR | Error | We had a problem with our server. Please to try again later. |
500 | failed | TRANSACTION_MUST_BE_AUTHORIZED | Error | Invalid operation, the status of the transaction must be authorized |
501 | failed | NOT_IMPLEMENTED | Error | For the context of the current business unit, this feature is not supported. |
502 | failed | BAD_GATEWAY | Error | INVALID ORIGINATING SYSTEM |
502 | failed | BAD_GATEWAY | Error | ERROR |
502 | failed | BAD_GATEWAY | Error | Oups... Something wrong on one of the underlying servers! Please contact the administrator to report the issue. |
502 | failed | BAD_GATEWAY | Error | The database is being updated |
502 | failed | BAD_GATEWAY | Error | Too many active sessions |
502 | failed | BAD_GATEWAY | Error | Email not registered |
502 | failed | BAD_GATEWAY | Error | The email of the cardholder was changed in the last 24 hours |
502 | failed | BAD_GATEWAY | Error | We had a problem with one of our backends that returns a http 500 status. Please to try again later. |