"error_create_payment" error message coming when I try to place an order on hosted checkout page

As the title says, I was trying to create a hosted checkout page (which i managed to do) but got the following error when I click on the “Place your order” button

 { "status": {"error_code":"ERROR_CREATE_PAYMENT","status":"ERROR","message":"","response_code":"ERROR_CREATE_PAYMENT","operation_id":"694b970d-378a-411a-82d8-fffc19515740"}}

I searched Rapyd’s docs for the ERROR_CREATE_PAYMENT error but nothing matched it.

Here is a screeshot of the payment details I put:

This was my request body to the checkout page API:

     "amount": 123.45,
     "complete_payment_url": "/checkout_success",
     "country": "US",
    "currency": "USD",
    "error_payment_url": "/error",
    "merchant_reference_id": "950ae8c6-78",
    "cardholder_preferred_currency": true,
    "language": "en",
    "metadata": {
        "merchant_defined": true
    "payment_method_types_include": [],
    "expiration": 1611384431,
    "payment_method_types_exclude": []

The error’s coming from this endpoint:

  • URL: “https://sandboxapi.rapyd.net/v1/checkout/checkout_05f0c1cd2f37225cf52d5fab96fde6a0
  • Method: POST
  • Status Code: 400
  • Request body: {"payment_method":{"address":null,"fields":{"number":"4111111111111111","cvv":"222","expiration_month":"05","expiration_year":"23","name":"Tanoo Joy"},"metadata":{},"type":"us_visa_card"},"payment_method_options":{},"client_details":{"session_id":"checkout_05f0c1cd2f37225cf52d5fab96fde6a0","device_timezone":"GMT+0800","operating_system":"Windows NT 4.0","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","device_fingerprint":"7806db3cc8c3f32f6b774f59ade3de2e"},"save_payment_method":false,"customer":"","selected_currency":"USD","card_brand":"Visa"}
  • Response: (The one at the top)

Would love to know what are the possible causes of this ERROR_CREATE_PAYMENT error.



Nevermind, I figure out the problem:

I had copied the request body from the docs and didn’t change the “expiration” field, which was a time in the past. Changed it to (new Date().getTime() + (60*60*1000)).toString() and it solved the issue.

@forum_moderators, Thanks anyway if you’re reading this :slight_smile: