Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function updates the URL to which a provider sends a user after they check out.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Market/set_url_after_checkout?provider=cPStore&access_token=725431a1-d5bc-11e5-a28b-8b0e09a93f05&order_id=12345&url_after_checkout=http%3A%2F%2Fcheckout.example.com

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Set url_after_checkout for order 12345 to http://checkout.example.com
$set_url = $cpanel->uapi(
    'Market', 'set_url_after_checkout',
     array(
        'provider'           => 'cPStore',
        'access_token'       => '725431a1-d5bc-11e5-a28b-8b0e09a93f05', 
        'order_id'           => '12345', 
        'url_after_checkout' => 'http://checkout.example.com'
 )
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Set url_after_checkout for order 12345 to http://checkout.example.com
my $set_url = $cpliveapi->uapi(
    'Market', 'set_url_after_checkout',    {
       'provider'           => 'cPStore',
       'access_token'       => '725431a1-d5bc-11e5-a28b-8b0e09a93f05', 
       'order_id'           => '12345', 
       'url_after_checkout' => 'http://checkout.example.com'
   }
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Template Toolkit
<!-- Set url_after_checkout for order 12345 to http://checkout.example.com -->
[% execute('Market', 'set_url_after_checkout', { provider => 'cPStore',access_token => '725431a1-d5bc-11e5-a28b-8b0e09a93f05',order_id => '12345',url_after_checkout => 'http://checkout.example.com'}) %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 

 Command Line
uapi --user=username Market set_url_after_checkout provider=cPStore access_token=725431a1-d5bc-11e5-a28b-8b0e09a93f05 order_id=12345 url_after_checkout=http%3A%2F%2Fcheckout.example.com

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{
   "result":{
      "errors":null,
      "messages":null,
      "status":1,
      "metadata":{
      },
    },
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
providerstring

Required

The cPanel Market provider's name.

A valid string.cPStore
access_tokenstring

Required

The access token for the session to the cPanel Market provider.

A valid access token.

725431a1-d5bc-11e5-a28b-8b0e09a93f05

order_id

integer

Required

The order ID that the cPanel Market provider assigned.

A positive integer.123456
url_after_checkoutstring

Required

The URL to send the browser after the user checks out.

A valid URL that cannot contain a query string.http://checkout.example.com

Returns

ParameterTypeDescriptionPossible valuesExample
error_typestring

Any errors that the function encounters.

Notes:

  • We introduced this return in cPanel & WHM version 11.56.1.
  • The function only returns this value if the module returns an exception because the provider user does not possess the order_id order.
A valid string.My dog has no nose.