# "error\_create\_payment" error message coming when I try to place an order on hosted checkout page

**URL:** https://community.rapyd.net/t/error-create-payment-error-message-coming-when-i-try-to-place-an-order-on-hosted-checkout-page/311
**Category:** ⚙️ API
**Created:** [May 29, 2021, 2:33am UTC](https://community.rapyd.net/t/error-create-payment-error-message-coming-when-i-try-to-place-an-order-on-hosted-checkout-page/311 "2021-05-29T02:33:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tanoojoy](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@tanoojoy](https://community.rapyd.net/u/tanoojoy)
#### Post date: [May 29, 2021, 2:33am UTC](https://community.rapyd.net/t/error-create-payment-error-message-coming-when-i-try-to-place-an-order-on-hosted-checkout-page/311/1 "2021-05-29T02:33:03Z")

</div>

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

```auto
 { "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:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/rapyd/original/1X/6b08f526be0e82b19ec335e4d58c4e6f466f8cda.png)

This was my request body to the checkout page API:

```json
{
     "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](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.

Tanoo

---

<div class="post-metadata">

### Author: ![tanoojoy](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@tanoojoy](https://community.rapyd.net/u/tanoojoy)
#### Post date: [May 29, 2021, 2:46am UTC](https://community.rapyd.net/t/error-create-payment-error-message-coming-when-i-try-to-place-an-order-on-hosted-checkout-page/311/2 "2021-05-29T02:46:23Z")

</div>

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 🙂
