API partenaire (B2B)
Détail du produit
GET /b2b/v1/products/:id — get one product by the id from search results.
Request#
GET
/b2b/v1/products/:idcurl "https://api.esimoa.com/b2b/v1/products/partner_9VKPYQ3JRYVK5797" \
-H "X-API-Key: $ESIMOA_PARTNER_KEY"const res = await fetch(`https://api.esimoa.com/b2b/v1/products/${encodeURIComponent(id)}`, {
headers: { 'X-API-Key': process.env.ESIMOA_PARTNER_KEY },
});
if (res.status === 404) {
// PRODUCT_NOT_FOUND — no longer on sale, remove it from your catalog
}
const { data: product } = await res.json();res = requests.get(
f"https://api.esimoa.com/b2b/v1/products/{product_id}",
headers={"X-API-Key": os.environ["ESIMOA_PARTNER_KEY"]},
timeout=10,
)
if res.status_code == 404:
... # PRODUCT_NOT_FOUND — no longer on sale
product = res.json()["data"]id est l’id issu des résultats de recherche de produits (il commence par partner_).
Réponse#
data est un objet PartnerProduct unique.
200 OKjson
{
"success": true,
"data": { "id": "partner_9VKPYQ3JRYVK5797", "name": "Japan Unlimited 5일", "...": "..." }
}Errors#
Un id mal formé, un id inconnu ou un produit qu’esimoa ne vend plus directement renvoie 404 PRODUCT_NOT_FOUND. Retirez-le de votre catalogue enregistré.
404 Not Foundjson
{ "statusCode": 404, "code": "PRODUCT_NOT_FOUND", "message": "Product not found." }