I am tring to send a POST request to the s2s API endpoint of switchere (https://api.switcherepay.com/post) , following the Documentation provided here : https://developer.switchere.com/api-v2/endpoints/s2s/.
I am getting a 404 error with this repsonse :
{
"result": "ERROR",
"error_code": 0,
"error_message": "Route or parameters is not supported",
"errors": []
}
This is the request I am sending, following the guide of the documentation. For security reasons all fields containing personal information are replaced with xxxxx.
{
"action": "SALE",
"client_key": "xxxxxx",
"card_cvv2": "123",
"card_number": "4111111111111111",
"card_exp_month": "01",
"card_exp_year": "2025",
"order_id": "xxxxxx",
"order_amount": 49.99,
"order_currency": "EUR",
"order_description": "xxxxxxx",
"payer_first_name": "John",
"payer_last_name": "Smith",
"payer_birth_date": "xxxx-xx-xx",
"payer_address": "123 Main St",
"payer_country": "US",
"payer_state": "NY",
"payer_city": "New York",
"payer_zip": "10001",
"payer_email": "[email protected]",
"payer_phone": "xxxxxxx",
"payer_ip": "xxx.xxx.x.x",
"term_url_3ds": "https://example.com",
"hash": "xxxxxxxx"
}
I am expecting my request to proceed, or at least get a relevant error on invalid fields or credentials. I am really troubled by the fact that I am getting an error 404 response. Doesn't that mean that the endpoint URL is wrong?
Answering my own questiion in case anyone else faces the same issue. The request must be sent as : application/x-www-form-urlencoded and not Json.
This is not stated anywhere on the documentation, at least until now.