NUHO API

Entrez votre cle API pour acceder a la documentation.


NUHO API

API interne — commandes, clients, KOL, produits. Auth : X-Api-Key header ou ?api_key=

Lecture (GET)

GET /api/orders

Commandes completes avec adresses, line items, TVA, fulfillments, refunds, paiement.

Parametres de requete
ParamDescription
daysFenetre en jours (defaut 90)
from / toDate range (ISO ou YYYY-MM-DD)
updated_sinceDelta sync — modifiees apres cette date
statuspaid, pending, refunded, authorized
fulfillmentfulfilled, unfulfilled, partial
emailEmail client
customerRecherche nom/email
cityVille
zipCode postal exact
countryCode pays (CH, FR, DE...)
provinceCanton/province
kolCode KOL exact
has_koltrue/false
tagTag commande
skuSKU exact
productNom du produit
discount_codeCode promo
gatewayMoyen de paiement
has_trackingtrue/false
has_refundtrue
cancelledtrue/false
min_total / max_totalMontant
order_number_min / order_number_maxPlage de numeros
sort / orderTri (created_at, total_price... + asc/desc)
page / per_pagePagination (max 250)
Champs de reponse (par commande)
ChampTypeDescription
idnumberID Shopify
namestring#1042
order_numbernumber1042
emailstringEmail du client
phonestringTelephone
created_atISO dateDate de creation
updated_atISO dateDerniere modification
processed_atISO dateDate de paiement
closed_atISO dateDate de cloture
cancelled_atISO dateDate d'annulation (null si non annulee)
cancel_reasonstringRaison d'annulation
financial_statusstringpaid, pending, refunded, partially_refunded
fulfillment_statusstringfulfilled, unfulfilled, partial, null
currencystringCHF
subtotal_pricenumberSous-total (sans shipping/taxes)
total_pricenumberTotal TTC
total_taxnumberTVA totale (0 actuellement)
total_discountsnumberTotal des remises
total_shippingnumberFrais de port
taxes_includedboolPrix TTC (true)
tax_exemptboolClient exonere
tax_lines[]arrayLignes TVA : title, rate (0.026), price
customerobjectid, email, first_name, last_name, phone, tags, tax_exempt, locale, accepts_marketing, orders_count, total_spent
billing_addressobjectfirst_name, last_name, company, address1, address2, city, province, province_code, zip, country, country_code, phone, lat, lng
shipping_addressobjectMeme structure que billing_address
line_items[]arrayid, product_id, variant_id, title, variant_title, sku, vendor, quantity, price, total_discount, grams, requires_shipping, taxable, tax_lines[], discount_allocations[]
shipping_lines[]arraytitle, price, code, source, carrier_identifier, tax_lines[]
fulfillments[]arrayid, status, created_at, tracking_number, tracking_numbers[], tracking_url, tracking_urls[], tracking_company, shipment_status, line_items[]
refunds[]arrayid, created_at, note, restock, refund_line_items[] (line_item_id, quantity, subtotal, total_tax), transactions[] (amount, currency, kind, gateway, status)
payment_gateway_names[]arrayEx: ["shopify_payments"], ["manual"]
processing_methodstringdirect, manual, offsite
discount_codes[]arraycode, amount, type (percentage/fixed_amount)
discount_applications[]arraytype (automatic/discount_code), title, value, value_type, target_type
notestringNote de commande
note_attributes[]arrayAttributs (dont kol_ref)
tagsstringTags de la commande
source_namestringweb, pos, shopify_draft_order
kol_refstringCode KOL attribue (null si aucun)
total_weightnumberPoids total en grammes

Pagination : count, total, page, per_page, total_pages

GET /api/customers

Clients avec adresses, tags, depenses, marketing, KOL.

Parametres de requete
ParamDescription
tagTag (kol, therapeute-20...)
emailEmail
nameNom
companyEntreprise
cityVille
zipCode postal
countryCode pays
provinceCanton
searchRecherche globale
localeLangue (fr, de, en...)
kol_onlytrue
tax_exempttrue
accepts_marketingtrue
has_phonetrue
has_addresstrue
min_spent / max_spentDepense
min_ordersNb commandes min
created_since / created_beforeDate range
sort / orderTri + direction
page / per_pagePagination
Champs de reponse (par client)
ChampTypeDescription
idstringID Shopify
emailstringEmail
first_name / last_namestringNom
phonestringTelephone
localestringLangue
tagsstringTags (virgule separee)
created_at / updated_atISO dateDates
verified_emailboolEmail verifie
tax_exemptboolExonere TVA
tax_exemptions[]arrayTypes d'exemptions
email_marketingstringSUBSCRIBED / NOT_SUBSCRIBED
sms_marketingstringSUBSCRIBED / NOT_SUBSCRIBED
notestringNote client
orders_countnumberNombre de commandes
total_spentnumberTotal depense (CHF)
currencystringCHF
vat_numberstringNumero de TVA (B2B)
default_addressobjectfirst_name, last_name, company, address1, address2, city, province, province_code, zip, country, country_code, phone
addresses[]arrayToutes les adresses (meme structure)
kol_codestringCode referral KOL
kol_pctnumberCommission %
kol_total_soldnumberVentes generees (CHF)
kol_orders_countnumberCommandes attribuees
kol_commission_duenumberCommission due (CHF)
kol_last_updatedstringDerniere MAJ des stats
kol_ibanstringIBAN pour paiement commission
kol_iban_namestringNom beneficiaire IBAN

GET /api/kols

Programme ambassadeur : KOLs, commissions, ventes, IBAN.

Champs de reponse

count, active, total_revenue, total_orders, total_commission + tableau kols[] (memes champs KOL que /api/customers).

GET /api/stats

Resume global. Param: days (defaut 90).

Champs de reponse
ChampDescription
orders.totalNombre de commandes
orders.today / week / monthCommandes jour/semaine/mois
orders.revenue_today / week / month / totalCA en CHF
customers.totalNombre de clients
customers.new_this_weekNouveaux cette semaine
customers.tagsComptage par tag
kol.count / activeKOL total/actifs
kol.total_revenue / total_commissionCA et commissions KOL
generated_atTimestamp de generation

GET /api/products

Catalogue produits. Param: status (active/draft/archived).

Champs de reponse (par produit)
ChampDescription
idID produit
titleNom
handleSlug URL
statusactive, draft, archived
product_typeType (Supplement)
vendorMarque (NUHO)
tagsTags produit
variants[]id, title, sku, barcode, price, compare_at_price, weight, weight_unit, inventory_item_id, inventory_quantity, requires_shipping, taxable
imagesrc, alt

Ecriture (POST)

POST /api/customer-create

Creer un client.

Body JSON
ChampRequisDescription
emailouiEmail du client
first_namenonPrenom
last_namenonNom
phonenonTelephone
tagsnonTags (array de strings)
notenonNote interne
addressnon{address1, city, zip, country_code, company, phone}
metafieldsnon[{namespace, key, type, value}]
Reponse
{"customer_id": "123", "email": "...", "name": "...", "tags": [...]}

POST /api/customer-update

Modifier un client. Tags proteges et metafields kol.* bloques.

Body JSON
ChampRequisDescription
customer_idouiID Shopify du client
vat_numbernonNumero de TVA
tags_addnonTags a ajouter (array)
tags_removenonTags a supprimer (array)
notenonNote client
metafieldsnon[{namespace, key, type, value}] — namespace "billing" uniquement
Reponse
{"customer_id": "123", "updated": {"metafields": [...], "tags_added": [...]}, "rejected": [...]}

POST /api/order-update

Modifier une commande.

Body JSON
ChampRequisDescription
order_idouiID de la commande
notenonNote de commande
tagsnonRemplace tous les tags (string)
tags_addnonAjouter des tags (array)
tags_removenonSupprimer des tags (array)
emailnonChanger l'email
shipping_addressnon{first_name, last_name, address1, city, zip, country_code, phone}
metafieldsnon[{namespace, key, type, value}]
Reponse
{"order_id": "123", "updated": {"order_updated": ["note","tags"], "tags_added": [...]}}

POST /api/order-fulfill

Expedier une commande avec tracking. Shopify envoie l'email de confirmation au client.

Body JSON
ChampRequisDescription
order_idouiID de la commande
tracking_numbernonNumero de suivi
tracking_companynonTransporteur (La Poste, DPD...)
tracking_urlnonURL de suivi
notify_customernonEnvoyer email au client (defaut: true)
messagenonMessage dans la notification
Reponse
{"order_id": "123", "fulfillment": {"id": "...", "status": "success", "tracking_number": "...", "tracking_company": "...", "created_at": "..."}}

POST /api/order-mark-paid

Marquer une commande pending comme payee (virement bancaire recu).

Body JSON
ChampRequisDescription
order_idouiID de la commande
Reponse
{"order_id": "123", "name": "#1042", "status": "paid", "amount": 72.90, "currency": "CHF", "transaction_id": "..."}

Si deja payee : {"status": "already_paid"}

POST /api/order-refund

Rembourser une commande (total ou partiel).

Body JSON
ChampRequisDescription
order_idouiID de la commande
amountnonMontant partiel (CHF). Si absent = remboursement total
line_itemsnon[{line_item_id, quantity}] — rembourser des articles specifiques
notenonRaison du remboursement
notifynonNotifier le client (defaut: true)
restocknonRemettre en stock (defaut: false)
restock_shippingnonRembourser aussi les frais de port
Reponse
{"order_id": "123", "refund_id": "...", "total_refunded": 13.40, "currency": "CHF", "line_items_refunded": [...]}

POST /api/order-cancel

Annuler une commande.

Body JSON
ChampRequisDescription
order_idouiID de la commande
reasonnoncustomer, fraud, inventory, declined, other
emailnonNotifier le client (defaut: true)
refundnonRembourser en meme temps (defaut: false)
restocknonRemettre en stock (defaut: true)
Reponse
{"order_id": "123", "name": "#1042", "status": "cancelled", "cancelled_at": "...", "financial_status": "refunded"}

POST /api/kol-create restreint

Creer un KOL ambassadeur.

Body JSON
ChampRequisDescription
emailouiEmail du KOL
codeouiSlug referral (1-40 chars, a-z 0-9 _ -)
commission_pctouiCommission en % (ex: 10)
first_namenonPrenom (requis si nouveau client)
last_namenonNom
ibannonIBAN pour paiement commission
iban_namenonNom du beneficiaire
Reponse
{"customer_id": "123", "email": "...", "name": "...", "kol_code": "CARLOS", "kol_pct": 10, "kol_link": "https://nuho.ch/?ref=CARLOS"}

POST /api/product-update restreint

Modifier un produit (prix, description, stock).

Body JSON
ChampRequisDescription
product_idouiID du produit
titlenonNouveau titre
body_htmlnonDescription HTML
tagsnonTags (remplace tous)
statusnonactive, draft, archived
variants[]nonid (requis), price, compare_at_price, sku, weight, barcode, inventory_quantity_adjust (+/-N)
Reponse
{"product_id": "123", "updated": {"product": {"id": "...", "title": "...", "variants": [...]}, "inventory_adjusted": [...]}}