Title: Woocommerce 2.4.12 &#8211; API Callbacks don&#039;t react
Last modified: August 30, 2016

---

# Woocommerce 2.4.12 – API Callbacks don't react

 *  [grauen](https://wordpress.org/support/users/grauen/)
 * (@grauen)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/woocommerce-2412-api-callbacks-dont-react/)
 * I wand to create an api callback in woocommerce so I can access an url and let
   my class do some work.
 * I created a new class which will handle the callback:
 *     ```
       <?php
   
       class WC_My_Gateway_Callback {
   
        	public function __construct() {
       		error_log("constructing callback class",0);
       add_action('woocommerce_api_wc_my_gateway_callback','handle_payment_callback');
       	}
       	function handle_payment_callback() {
        		error_log( "MyModule Callback in callback.php" , 0 );
        		exit;
       	 }
       }
       ?>
       ```
   
 * (I hope you don’t mind, I’m using the error_log for debugging …)
 * The class has been initialized and there was no error logged while adding the
   action.
 * According to the documentation:
    [https://docs.woothemes.com/document/wc_api-the-woocommerce-api-callback/](https://docs.woothemes.com/document/wc_api-the-woocommerce-api-callback/)
 * I can now trigger the function handle_payment_callback() of this class.
 * I activated the rest api, I created a new user, I generated a key and a secret.
 * I can access functions like /wc-api/v3/order – so my setup must be okay.
 * I try to access my function like this:
    `https://mydomain.com/wordpress/wc-api/
   v3/wc_my_gateway_callback?consumer_key=ck_MYGENERATEDKEY&consumer_secret=cs_MYGENERATEDSECRET`
 * This will return:
    `{"errors":[{"code":"woocommerce_api_no_route","message":"
   No route was found matching the URL and request method"}]}`
 * Can you see what I did wrong?

The topic ‘Woocommerce 2.4.12 – API Callbacks don't react’ is closed to new replies.

## Tags

 * [callback](https://wordpress.org/support/topic-tag/callback/)
 * [webhook](https://wordpress.org/support/topic-tag/webhook/)
 * [WooThemes](https://wordpress.org/support/topic-tag/woothemes/)

 * 0 replies
 * 1 participant
 * Last reply from: [grauen](https://wordpress.org/support/users/grauen/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/woocommerce-2412-api-callbacks-dont-react/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
