Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cheking out a cart ends up with 403 forbidden. #127

Open
BouzayenMohamed opened this issue May 25, 2023 · 1 comment
Open

cheking out a cart ends up with 403 forbidden. #127

BouzayenMohamed opened this issue May 25, 2023 · 1 comment
Labels
triage/waiting-for-answer Waiting for the reporter to answer

Comments

@BouzayenMohamed
Copy link

Am trying to automate the process of provisioning a new VPS from ovh but i end up with 403 when trying to checkout the cart
i dont know where the fault is
(i think am misconfigured the vps item in the cart )

Client error: POST https://eu.api.ovh.com/1.0/order/cart/85c4dcbe-6b61-4078-b91b-154f373841cc/checkout resulted in a 403 Forbidden response:
{"class":"Client::Forbidden","message":"You are not allowed"}

`if ($isPlanAvailable) {
                    $result = $ovh->post("/order/cart/".$cartId."/vps", array(
                    'duration' => "P1Y", // Duration selected for the purchase of the product (type: string)
                    'planCode' => "s1-2", // Identifier of the offer (type: string)
                    'pricingMode' => "default", // Pricing mode selected for the purchase of the product (type: string)
                    'quantity'=> 1, // Quantity of product desired (type: integer)
                    ));
                    $assign =$ovh->post("/order/cart/".$cartId."/assign");
                    // /order/cart/{cartId}/item/{itemId}/requiredConfiguration
                    $result = $ovh->get("/order/cart/".$cartId."/item");

                    $reqconfig = $ovh->get("/order/cart/".$cartId."/item/".$result[0]."/requiredConfiguration");
                    $config = $ovh->post("/order/cart/".$cartId."/item/".$result[0]."/configuration", array(
                    'label' => "ps_os",
                    'value' => "Ubuntu 19.10",
                    'label' => "vps_datacenter", // Label for your configuration item (type: string)
                    'value' => "GRA", // Value or resource URL on API.OVH.COM of your configuration item (type: string)
                    ));


                    //$check = $ovh->get("/order/cart/".$cartId."/checkout");

                    $checkout = $ovh->post("/order/cart/".$cartId."/checkout", array(
                    'waiveRetractationPeriod' => false, // Indicates that order will be processed with waiving retractation period (type: boolean)
                    'autoPayWithPreferredPaymentMethod' => false, // Indicates that order will be automatically paid with preferred payment method (type: boolean)
                    ));
                    

                    } else {
                        
                    }`
@rbeuque74
Copy link
Member

Hello @BouzayenMohamed,

Can you provide a debugging response header "X-OVH-QUERYID" to be able to investigate deeper on OVHcloud side.

Thanks,
Romain

@rbeuque74 rbeuque74 added the triage/waiting-for-answer Waiting for the reporter to answer label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/waiting-for-answer Waiting for the reporter to answer
Projects
None yet
Development

No branches or pull requests

2 participants