OVHcloud Community

Welcome to your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.

API - Transfer domain to OVH


#1

Hi
I’m trying to develop a service that transfers a domain to OVH. I already have the transfer authorization key, provided by the client.

This is what I do:
I create the order.
I research if the domain is available for transfer. I add the domain to the order.
I link the order to my account.
I make the checkout request.
But it never asks me for the transfer authorization key.

This is my code:

string domain = “teste.pt”;
var prms = new
{
description = “order - " + domain,
ovhSubsidiary = “PT”
};
OVHCart cart = await client.PostAsync(”/order/cart", prms);
//Response: { “cartId”: “3b36d321-8fbc-41eb-8535-54a29943abe6”, “description”: “order - teste.pt”, “expire”: “2022-05-13T16:39:53+00:00”, “readOnly”: false, “items”: [] }

QueryStringParams qprms = new QueryStringParams();
qprms.Add(“domain”, domain);
OVHCartDomain[] checkDomain = client.GetAsync<OVHCartDomain[]>($"/order/cart/{cart.cartId}/domain", qprms).Result;
//Response: [{“action”:“transfer”,“configurations”:[],“deliveryTime”:"",“duration”:[“P1Y”],“offer”:“gold”,“offerId”:“pt-transfer”,“orderable”:true,“phase”:“ga”,“prices”:[{“label”:“PRICE”,“price”:{“currencyCode”:“EUR”,“text”:“0.00 €”,“value”:0}},{“label”:“RENEW”,“price”:{“currencyCode”:“EUR”,“text”:“8.99 €”,“value”:8.99}},{“label”:“DISCOUNT”,“price”:{“currencyCode”:“EUR”,“text”:“0.00 €”,“value”:0}},{“label”:“FEE”,“price”:{“currencyCode”:“EUR”,“text”:“0.00 €”,“value”:0}},{“label”:“TOTAL”,“price”:{“currencyCode”:“EUR”,“text”:“0.00 €”,“value”:0}}],“pricingMode”:“default”,“productId”:“domain”,“quantityMax”:1}]

if (checkDomain != null && checkDomain.Length > 0)
{
foreach (OVHCartDomain cd in checkDomain)
{
if (cd.action == “transfer” && cd.orderable) //só adiciono se a ação for “transfer” e se for “orderable”
{
var transferDomain = new
{
domain = domain//,
//duration = period
};
OVHCartItem domainItem = client.PostAsync($"/order/cart/{cart.cartId}/domain", transferDomain).Result;
//Response: {“cartId”:“3b36d321-8fbc-41eb-8535-54a29943abe6”,“configurations”:[102402315],“duration”:“P1Y”,“itemId”:156231389,“offerId”:null,“options”:[],“prices”:[{“label”:“TOTAL”,“price”:{“currencyCode”:“EUR”,“text”:“0.00 €”,“value”:0.0}},{“label”:“RENEW”,“price”:{“currencyCode”:“EUR”,“text”:“0.00 €”,“value”:0.0}},{“label”:“PRICE”,“price”:{“currencyCode”:“EUR”,“text”:“0.00 €”,“value”:0.0}}],“productId”:“domainblog”,“settings”:{“catalogName”:“dom-public”,“domain”:“teste.pt”,“planCode”:“pt”,“pricingMode”:“transfer-default”,“quantity”:1}}

		Task t = client.PostAsync($"/order/cart/{cart.cartId}/assign");
		t.Wait();

		OVHCartCheckout cartCheckout = client.GetAsync<OVHCartCheckout>($"/order/cart/{cart.cartId}/checkout").Result;
		//Response: {"contracts":[{"content":"???","name":"contrat_partDomain","url":"https://storage.gra.cloud.ovh.net/v1/AUTH_325716a587c64897acbef9a4a4726e38/contracts/547c802-contrat_partDomain-PT-1.0.pdf"},{"content":"???","name":"Contrato_de_Tratamento_de_Dados_Pessoais","url":"https://storage.gra.cloud.ovh.net/v1/AUTH_325716a587c64897acbef9a4a4726e38/contracts/29cde63-OVH_Data_Protection_Agreement-PT-5.1.pdf"},{"content":"????","name":"Condicoes gerais de servico","url":"https://storage.gra.cloud.ovh.net/v1/AUTH_325716a587c64897acbef9a4a4726e38/contracts/dd8fe8e-contrat_genServices-PT-4.0.pdf"}],"details":[{"cartItemID":null,"description":"teste.pt - DNS Zone","detailType":"DURATION","domain":"*001.001","originalTotalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"quantity":1,"reductionTotalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"reductions":[],"totalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"unitPrice":{"currencyCode":"EUR","text":"0.00 €","value":0}},{"cartItemID":null,"description":"DNS zone","detailType":"INSTALLATION","domain":"*001.001","originalTotalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"quantity":1,"reductionTotalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"reductions":[],"totalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"unitPrice":{"currencyCode":"EUR","text":"0.00 €","value":0}},{"cartItemID":null,"description":"teste.pt - .pt transfer request","detailType":"DURATION","domain":"*001","originalTotalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"quantity":1,"reductionTotalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"reductions":[],"totalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"unitPrice":{"currencyCode":"EUR","text":"0.00 €","value":0}},{"cartItemID":null,"description":"Domain .pt","detailType":"INSTALLATION","domain":"*001","originalTotalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"quantity":1,"reductionTotalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"reductions":[],"totalPrice":{"currencyCode":"EUR","text":"0.00 €","value":0},"unitPrice":{"currencyCode":"EUR","text":"0.00 €","value":0}}],"orderId":null,"prices":{"originalWithoutTax":{"currencyCode":"EUR","text":"0.00 €","value":0},"reduction":{"currencyCode":"EUR","text":"0.00 €","value":0},"tax":{"currencyCode":"EUR","text":"0.00 €","value":0},"withTax":{"currencyCode":"EUR","text":"0.00 €","value":0},"withoutTax":{"currencyCode":"EUR","text":"0.00 €","value":0}},"url":null}
	}
}

}

What am I missing?

Thanks


#2

Hello @PauloF,

Feel free to ask your question on the api mailin list.

https://eu.api.ovh.com/

api-subscribe@ml.ovh.net

^FabL