According to mentioned extract variable policy , you should be hitting
[https://{apigee.host}/application/tworder/v1/ip-customers/*/ip-users/{customerId}](https://{apigee.host}/application/tworder/v1/ip-customers/*/ip-users/{customerId})
to make this work .As URI path in apigee does not contain base path , even though it is a URI fragment , it’s just a string that uniquely identifies the URI path used by Apigee Edge to route incoming messages to the proper API proxy much like a sever’s context path.
If your customerId is present at wildcard in base path , then you don’t have to go through all this trouble to extract customer id and assign it to target url , as apigee uri and target uri have 1-1 mapping and apigee uses the same URI to hit target backend if there is no modification. You just need to use basepath and target path properly.
<HTTPProxyConnection>
<BasePath>/application/tworder/v1</BasePath>
<Properties/>
<VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
<HTTPTargetConnection>
<LoadBalancer>
<Server name="appTargetURL"/>
</LoadBalancer>
<Path>/application/tworder/v1</Path>
</HTTPTargetConnection>
In this case if you hit apigee path
[https://{apigee-host}/application/tworder/v1/ip-customers/{customerId}/ip-users/](https://{apigee-host}/application/tworder/v1/ip-customers/{customerId}/ip-users/)
request will go to ,
[https://{target-host}/application/tworder/v1/ip-customers/{customerId}/ip-users/](https://{target-host}/application/tworder/v1/ip-customers/{customerId}/ip-users/)
you can also use conditional flows to apply any other policies required for this, like extracting customer Id
<Flows>
<Flow name="name">
<Description/>
<Request>
<Step>
<Name>EV-ExtractCustomerId</Name>
</Step>
</Request>
<Response/>
<Condition>(proxy.pathsuffix MatchesPath "/ip-customers/{customerId}/ip-users/")</Condition>
</Flow>
</Flows>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="Extract-path-variable-from-request">
<DisplayName>Extract-Path-Variable-From-Request</DisplayName>
<Properties/>
<URIPath>
<Pattern ignoreCase="true">/ip-customers/{customerId}/ip-users/</Pattern>
</URIPath>
<Source clearPayload="false">request</Source>
<VariablePrefix>apigee</VariablePrefix>
</ExtractVariables>
Now , this will set proper value of apigee.customerId in context.
Hope this will help !!