# I Need help about: ERROR\_CREATE\_PAYMENT

**URL:** <https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138>\
**Category:** 🙋🏽‍♀️🙋🏽‍♂️ Ask Questions\
**Tags:** payments\
**Created:** [June 7, 2022, 8:48am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138 "2022-06-07T08:48:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jax.Yang](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jax.Yang](https://community.rapyd.net/u/Jax.Yang)\
**Post date:** [June 7, 2022, 8:48am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/1 "2022-06-07T08:48:22Z")

</div>

Hello everyone, I meet a problem  
when I clicking place order button after creating checkout page, the page send out an ajax,  
And this ajax reponds with 400, the detial is following:  
{“status”:{“error\_code”:“ERROR\_CREATE\_PAYMENT”,“status”:“ERROR”,“message”:"",“response\_code”:“ERROR\_CREATE\_PAYMENT”,“operation\_id”:"…"}}  
Request URL is  
[https://api.rapyd.net/v1/checkout/checkout\_](https://api.rapyd.net/v1/checkout/checkout_)…

I really don’t know why, could anybody help please?

---

<div class="post-metadata">

**Author:** ![CharlesDorsett](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/charlesdorsett/32/47_2.png) [@CharlesDorsett](https://community.rapyd.net/u/CharlesDorsett)\
**Post date:** [June 7, 2022, 8:59am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/2 "2022-06-07T08:59:54Z")

</div>

@Jax.Yang - Please post the complete request (URL and body of the request). Was this in sandbox or production?

---

<div class="post-metadata">

**Author:** ![Jax.Yang](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jax.Yang](https://community.rapyd.net/u/Jax.Yang)\
**Post date:** [June 7, 2022, 9:17am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/3 "2022-06-07T09:17:16Z")

</div>

Hi @CharlesDorsett ,  
This is in production,  
request url is: `https://api.rapyd.net/v1/checkout/checkout_00835dd26835ba0415e7c88e656da443`  
request payload is `{"payment_method":{"type":"jp_711_cash","name":"","address":null,"metadata":{},"fields":{"name":"test","phone_number":"12345678"}},"client_details":{"session_id":"checkout_00835dd26835ba0415e7c88e656da443","device_timezone":"GMT+0800","operating_system":"Windows","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36","device_fingerprint":"633d00ce5f549549b61a2cd3a16f86f6","language":"zh-CN","java_enabled":false,"javascript_enabled":true,"screen_color_depth":24,"screen_height":960,"screen_width":1536,"window_height":809,"window_width":942,"timezone_offset":-480},"payment_method_options":{},"customer_required_fields":{},"selected_currency":"JPY","selected_category":"cash","cancel_fixed_side_buy":false}`

---

<div class="post-metadata">

**Author:** ![CharlesDorsett](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/charlesdorsett/32/47_2.png) [@CharlesDorsett](https://community.rapyd.net/u/CharlesDorsett)\
**Post date:** [June 7, 2022, 10:16am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/4 "2022-06-07T10:16:40Z")

</div>

Hi @Jax.Yang - I can see several problems - I’m using **[Create Checkout Page](https://docs.rapyd.net/build-with-rapyd/reference/checkout-page-object#create-checkout-page)** as a reference.

First, post [https://api.rapyd.net/v1/checkout/{{checkout}](https://api.rapyd.net/v1/checkout/%7B%7Bcheckout%7D)} is not a supported endpoint. To create the checkout page, you have to use **[https://api.rapyd.net/v1/checkout](https://api.rapyd.net/v1/checkout)**

Second, your payload is missing several required parameters:

- `amount`
- `country`
- `currency`

Third (not related to your error, but …) you have included a lot of fields that are not documented in the API Reference. I don’t think these will affect the request, but I’m curious to know where you got these fields and values from.

---

<div class="post-metadata">

**Author:** ![Jax.Yang](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jax.Yang](https://community.rapyd.net/u/Jax.Yang)\
**Post date:** [June 7, 2022, 10:28am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/5 "2022-06-07T10:28:10Z")

</div>

Hi @CharlesDorsett, sorry, I think I didn’t explain well, I did use endpoint **[https://api.rapyd.net/v1/checkout](https://api.rapyd.net/v1/checkout)** to create a checkout page, after I get the `redirect_url` from response value and open the checkout page in Chrome, and then clicking button “Place Your Order”, the page popup an error,

 ![image](https://us1.discourse-cdn.com/flex016/uploads/rapyd/original/2X/a/a36ac71481f5e8d0c8ca9d72b5981f0919aec01c.png)

So I check “Network” and found an error ajax send by Rapyd, which I mentioned when this topic started

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

And this error stop me to continue my following payment

---

<div class="post-metadata">

**Author:** ![CharlesDorsett](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/charlesdorsett/32/47_2.png) [@CharlesDorsett](https://community.rapyd.net/u/CharlesDorsett)\
**Post date:** [June 7, 2022, 10:34am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/6 "2022-06-07T10:34:46Z")

</div>

I think you should open a support ticket at [https://support.rapyd.net/](https://support.rapyd.net/) - they can look into the logs and find out exactly what went wrong.

---

<div class="post-metadata">

**Author:** ![Jax.Yang](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jax.Yang](https://community.rapyd.net/u/Jax.Yang)\
**Post date:** [June 7, 2022, 10:45am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/7 "2022-06-07T10:45:35Z")

</div>

😀 Alright, thanks for the advices @CharlesDorsett

---

<div class="post-metadata">

**Author:** ![drew.harris](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/drew.harris/32/1259_2.png) [@drew.harris](https://community.rapyd.net/u/drew.harris)\
**Post date:** [June 7, 2022, 1:41pm UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/8 "2022-06-07T13:41:20Z")

</div>

Hey @Jax.Yang let us know here in the community what you find out from support and feel free to post the answer back here. Hope if gets worked out soon for you.

---

<div class="post-metadata">

**Author:** ![Daniel\_Rojansky](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/daniel_rojansky/32/1829_2.png) [@Daniel\_Rojansky](https://community.rapyd.net/u/Daniel_Rojansky)\
**Post date:** [June 7, 2022, 5:44pm UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/9 "2022-06-07T17:44:04Z")

</div>

Hi @Jax.Yang did you open a ticket ?

---

<div class="post-metadata">

**Author:** ![Jax.Yang](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jax.Yang](https://community.rapyd.net/u/Jax.Yang)\
**Post date:** [June 8, 2022, 6:44am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/10 "2022-06-08T06:44:53Z")

</div>

ok, thanks, I will post the answer once I figure this out

---

<div class="post-metadata">

**Author:** ![fredjinbility](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@fredjinbility](https://community.rapyd.net/u/fredjinbility)\
**Post date:** [June 11, 2022, 6:17pm UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/11 "2022-06-11T18:17:01Z")

</div>

@Jax.Yang When you get Error with **Status Code 400** , it simply indicates that the server cannot process the request due to some malformed request syntax, invalid request message framing or deceptive request calls.

If you can share the portion of the code that are causing the issue, it will be easier for us to find the exact solution to your problem. What language are you  
using at backend.

Hope to hear from you soon

---

<div class="post-metadata">

**Author:** ![Jax.Yang](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jax.Yang](https://community.rapyd.net/u/Jax.Yang)\
**Post date:** [June 13, 2022, 7:22am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/12 "2022-06-13T07:22:36Z")

</div>

Hi @fredjinbility, I think the problem is not in my codes which requesting Rapyd endpoint, because the error ajax is send by Rapyd’s js code from the checkout page. I have opened a ticket several days ago in the support center of Rapyd Client Portal, they said they are investgating:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/rapyd/original/2X/e/ec0326b54065676a590a7cc2e0b3072de8baac6d.png)  
I hope they can give me a solution ASAP. 😔

---

<div class="post-metadata">

**Author:** ![fredjinbility](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@fredjinbility](https://community.rapyd.net/u/fredjinbility)\
**Post date:** [June 13, 2022, 11:20am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/13 "2022-06-13T11:20:22Z")

</div>

@Jax.Yang, Thanks for getting back and I wish you are good.

Just a hint, while your issues is being investigated by Rapyd Support Team via your submitted ticket.

Please, I just want you to also check two things from your own end.

1.)Ensure that your ajax call is not blocked via access contol origin request

2.) Ensure that your application does not sends the **OPTIONS preflight** request (which has no body) before the POST.  
This is to ensure that your ajax call does not try to pass non-existent body parameters from OPTIONS to the **Rapyd API** ,  
resulting in an exception caught by your catch handler, which responds with a **400** status error code.

3.) I will post a working ajax call solution in a mean time so that you can try it out and compare it to yours.

Thank you

---

<div class="post-metadata">

**Author:** ![fredjinbility](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@fredjinbility](https://community.rapyd.net/u/fredjinbility)\
**Post date:** [June 13, 2022, 5:53pm UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/14 "2022-06-13T17:53:39Z")

</div>

Hi @Jax.Yang, this is a Dynamic working sample with jquery/ajax and php  
**Here is how it works.**

When a User Click on the **Purchase button** , An **Ajax** Call is used to Post the Purchased items to dynamically generate a **Payment Checkout Page Id** on the fly by passing the data to **Process\_checkout.php**. If the Checkout Page is successfully created, Then Rapyd Payment System is loaded for user to complete Payments.

Upon **Visa or Master Card Payments** , An Ajax Call is automatically made to **Rapyd Checkout Retrieval API** to update and get **Payments ID, Payment Status** etc.

If Other Payments method other than Card is used, Upon Payments, The User will be redirected to Rapyd Payments Completion Page to complete his Payments and payments status and other details are automatically fetched…

**Here is the steps for testing:**

1.)Edit **settings.php** to configure your Rapyd Payments API details, Languages, Payment methods etc. where appropriates.

2.) Edit **Rapyd\_access\_keys.php** to configure your Sandbox Rapyd Access Keys and Secret.

To use it in **production** , You can also change the API URL to point to productions API Endpoint and also remember to enter access credentials for Productions.

3.) Whatever Payment method that you configure in setting.php must correspond dynamically with the one coded in the **process\_checkout.php**. please see this line of code

```auto

"payment_method_types_include" => [
$payment_method_types_include_grabpay,
    "$payment_method_types_include_visacard",
   "$payment_method_types_include_mastercard",

    ]
];

```

You can call up browser and test your code at

[http://localhost/rapyd\_ajax/index.php](http://localhost/rapyd_ajax/index.php)

You can download sample from my google drive [Drive Sample](https://drive.google.com/file/d/186qHVCd3pmCjyfsFVg_0D3pdzJG5D7m3/view?usp=sharing)

If have any further problem, let me know. Thanks

---

<div class="post-metadata">

**Author:** ![Jax.Yang](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jax.Yang](https://community.rapyd.net/u/Jax.Yang)\
**Post date:** [June 14, 2022, 3:12am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/15 "2022-06-14T03:12:26Z")

</div>

Hi @fredjinbility Thanks for the help and code share 🤝. And I did some tests, I found there is only one cash payment method is working which is “ **jp\_familymart\_cash** ”, and other JP cash method will return ajax 400 error, this really confuse me. 😂  
I still think the problem is not in the code level, I hope Rapyd support center can reply me ASAP.

---

<div class="post-metadata">

**Author:** ![fredjinbility](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@fredjinbility](https://community.rapyd.net/u/fredjinbility)\
**Post date:** [June 14, 2022, 7:06am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/16 "2022-06-14T07:06:28Z")

</div>

Thanks for getting back @Jax.Yang, I have tested the Payments method supported by **Rapyd** for **Japan** and all the payments are going through and working fine. There is no ajax error code on my own end

Here is the 17 method of payments supported by Rapyd for Japan

```auto

 jp_711_cash 
jp_lawson_cash 
jp_familymart_cash
jp_ministop_cash 
jp_seicomart_cash
jp_diners_card
jp_banktransfer_bank 
jp_credit_card
jp_softbankphysical_carrier_ewallet 
jp_amex_card 
jp_docomophysical_carrier_ewallet
jp_mastercard_card 
 jp_visa_card 
jp_softbankdigital_carrier_ewallet 
jp_famipay_ewallet
jp_jcb_card
jp_docomodigital_carrier_ewallet

```

I have launched the testing sample online so that you can test the code and see that all Payments are working fine.  
[Online Testing Sample](https://fredjarsoft.com/rapyd_ajax/index.php)

I will take the link down as soon as testing is done. Thank You…

---

<div class="post-metadata">

**Author:** ![Jax.Yang](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jax.Yang](https://community.rapyd.net/u/Jax.Yang)\
**Post date:** [June 14, 2022, 7:49am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/17 "2022-06-14T07:49:31Z")

</div>

Hi @fredjinbility, thanks for the link 🤝. I tried and it’s successful indeed.

But my problem occured in production environment, not sandbox. I also did my test in sandbox environment, there is no error indeed. I think there is some differences between Raypd sandbox and Rapyd prodcution environment.

BTW, I compared the ajax’s payload between sandbox and production, they are almost same, only endpoints have different domain.

This is sandbox: [https://sandboxapi.rapyd.net/](https://sandboxapi.rapyd.net/)  
This is prod: [https://api.rapyd.net/](https://api.rapyd.net/)

---

<div class="post-metadata">

**Author:** ![Daniel\_Rojansky](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/daniel_rojansky/32/1829_2.png) [@Daniel\_Rojansky](https://community.rapyd.net/u/Daniel_Rojansky)\
**Post date:** [June 14, 2022, 8:39am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/18 "2022-06-14T08:39:25Z")

</div>

Do you need any more help ?

---

<div class="post-metadata">

**Author:** ![Jax.Yang](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jax.Yang](https://community.rapyd.net/u/Jax.Yang)\
**Post date:** [June 14, 2022, 8:54am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/19 "2022-06-14T08:54:53Z")

</div>

Thanks @Daniel_Rojansky , now I think the only thing I can do is waiting

---

<div class="post-metadata">

**Author:** ![Daniel\_Rojansky](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/daniel_rojansky/32/1829_2.png) [@Daniel\_Rojansky](https://community.rapyd.net/u/Daniel_Rojansky)\
**Post date:** [June 14, 2022, 11:14am UTC](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138/20 "2022-06-14T11:14:01Z")

</div>

@CharlesDorsett can you help ?

[Next page](https://community.rapyd.net/t/i-need-help-about-error-create-payment/2138.md?page=2)
