Django rest framework APIView register route

Routers won't work with APIView. They only work with ViewSets and their derivatives.

You likely want:

class PayOrderViewSet(ModelViewSet):

Routers and APIViews (generic or otherwise) are two different ways to create API endpoints. Routers work with viewsets only.

In your code, you are although trying to create a viewset for a router your code is extending APIView class.

Your problem will be taken care by what @linovia has suggested in his asnwer. I would suggest it will be good idea to understand the difference between those two.

GenericViewSet inherits from GenericAPIView but does not provide any implementations of basic actions. Just only get_object, get_queryset.

ModelViewSet inherits from GenericAPIView and includes implementations for various actions. In other words you dont need implement basic actions as list, retrieve, create, update or destroy. Of course you can override them and implement your own list or your own create methods.

Read More about viewsets and Generic Class Based APIViews :