Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › internal_server_error
- This topic has 5 replies, 2 voices, and was last updated 1 month, 1 week ago by Soft79.
-
AuthorPosts
-
August 15, 2023 at 9:05 pm #19938Shazaan AliParticipant
Hello
I have been using the FREE version for a while. But I was having issues with creating orders via API.
When a coupon has restrictions by shipping method, and you try and place the order via API. It throws a internal_server_error.
I noticed that the PRO version said it has API Developer features, so I purchased it thinking you may have added this restriction to FREE version. But to my disappointment it still did not work..
This is what I am attempting to do:
POST: https://DOMAIN/wp-json/wc/v3/orders
BODY:
{
“customer_id”: 13784,
“status”: “processing”,
“payment_method”: “cod”,
“payment_method_title”: “Cash on Delivery”,
“set_paid”: false,
“coupon_lines”: [
{
“code”: “col20restricted”
}
],
“shipping_lines”: [
{
“method_title”: “Collection”,
“method_id”: “local_pickup”
}
],
“customer_note”: “”,
“billing”: {
“first_name”: “Test”,
“last_name”: “test”,
“address_1”: “1 London Road”,
“city”: “London”,
“state”: “England”,
“postcode”: “L1 1AB”,
“country”: “United Kingdom”,
“email”: “abc@abc.com”,
“phone”: “+123”,
“customer_id”: 13784
},
“shipping”: {
“first_name”: “Test”,
“last_name”: “test”,
“address_1”: “1 London Road”,
“city”: “London”,
“state”: “England”,
“postcode”: “L1 1AB”,
“phone”: “+123”,
“country”: “United Kingdom”,
“customer_id”: 13784
},
“line_items”: [
{
“product_id”: 15865,
“quantity”: 10,
“total”: “27”,
“meta_data”: [
]
}
]}
The error that is getting thrown (using POSTMAN) is:
{
“code”: “internal_server_error”,
“message”: “<p>There has been a critical error on this website.</p><p>Learn more about troubleshooting WordPress.</p>”,
“data”: {
“status”: 500
},
“additional_errors”: []
}If I REMOVE the restriction on the coupon (the “Checkout” section -> “Shipping methods”), then the coupon works fine.
Can you please help?
Thank You
August 16, 2023 at 12:43 am #19939Soft79KeymasterWhat is the error? You can see this if you enable WP_DEBUG_LOG.
August 16, 2023 at 7:38 am #19941Shazaan AliParticipantHi
We are placing the order via REST API. therefore how will the debugging on wp-end help?August 16, 2023 at 8:41 am #19942Soft79KeymasterThe API request is handled by WP, so any errors can be logged by WP. If you have a PHP log enabled you can also check that PHP log.
August 16, 2023 at 11:30 am #19944Shazaan AliParticipantOh ok.
But what is the “API” description that you mentioned in the PRO version about?
August 16, 2023 at 11:59 am #19946Soft79KeymasterFunctions, hooks and filters to extend functionality of the plugin through PHP.
-
AuthorPosts
- You must be logged in to reply to this topic.