UAPI Functions - Market::set_url_after_checkout

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

 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'
 )
);

 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'
   }
);

 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'}) %]

 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.

 Output (JSON)

{
   "result":{
      "errors":null,
      "messages":null,
      "status":1,
      "metadata":{
      },
    },
}

 

Note:

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

 

Parameters

Parameter

Type

Description

Possible values

Example

provider

string

Required

The cPanel Market provider's name.

A valid string.

cPStore

access_token

string

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_checkout 

string

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

 Parameter 

 Type 

Description

 Possible values 

Example

error_type

string

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 modules throws an exception because the user or users at the provider does not have the order_idorder.

A valid string.

 My dog has no nose. 

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....