{"openapi":"3.1.0","info":{"title":"SocialLikeYou \u2014 API REST","version":"1.0.0","description":"API JSON des revendeurs. Authentification : en-t\u00eate \u00ab Authorization: Bearer <cl\u00e9 API> \u00bb. Quota par d\u00e9faut : 120 requ\u00eates par minute et par cl\u00e9. Les notifications de changement de statut (webhooks) sont sign\u00e9es : en-t\u00eate X-Webhook-Signature \u00ab t=<horodatage>,v1=<HMAC-SHA256 hex de \"<horodatage>.<corps>\" avec votre secret> \u00bb."},"servers":[{"url":"https:\/\/sociallikeyou.com\/api\/rest\/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"schemas":{"Order":{"type":"object","properties":{"id":{"type":"integer"},"service_id":{"type":"integer"},"link":{"type":"string"},"quantity":{"type":"integer"},"remains":{"type":"integer","nullable":true},"start_count":{"type":"integer","nullable":true},"status":{"type":"string","enum":["pending","processing","in_progress","completed","partial","canceled"]},"charge":{"type":"string","example":"1.5"},"refunded":{"type":"string","example":"0"},"currency":{"type":"string","example":"EUR"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"Service":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"category":{"type":"string"},"rate_per_1000":{"type":"string"},"min":{"type":"integer"},"max":{"type":"integer"},"refill":{"type":"boolean"},"cancel":{"type":"boolean"}}},"Webhook":{"type":"object","properties":{"event":{"type":"string","example":"order.completed"},"created_at":{"type":"string","format":"date-time"},"data":{"$ref":"#\/components\/schemas\/Order"}}}}},"paths":{"\/services":{"get":{"summary":"Catalogue des services","responses":{"200":{"description":"Liste","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Service"}}}}}}},"401":{"description":"Cl\u00e9 invalide","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/balance":{"get":{"summary":"Solde du compte","responses":{"200":{"description":"Solde","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"balance":{"type":"string"},"currency":{"type":"string"}}}}}}}}}}},"\/orders":{"get":{"summary":"Lister les commandes","parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"per_page","in":"query","schema":{"type":"integer","maximum":100}}],"responses":{"200":{"description":"Page de commandes","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Order"}},"meta":{"type":"object"}}}}}}}},"post":{"summary":"Passer une commande (idempotente)","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":100},"description":"Identifiant unique de votre demande : la renvoyer apr\u00e8s une coupure ne cr\u00e9e pas de seconde commande."}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["service_id","link","quantity"],"properties":{"service_id":{"type":"integer"},"link":{"type":"string","format":"uri"},"quantity":{"type":"integer"}}}}}},"responses":{"201":{"description":"Commande cr\u00e9\u00e9e","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Order"}}}}}},"200":{"description":"M\u00eame cl\u00e9 d\u00e9j\u00e0 re\u00e7ue : commande existante renvoy\u00e9e"},"400":{"description":"Cl\u00e9 d\u2019idempotence absente","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"402":{"description":"Solde insuffisant","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Commande refus\u00e9e","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Quota d\u00e9pass\u00e9","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/orders\/{id}":{"get":{"summary":"D\u00e9tail d\u2019une commande","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Commande","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Order"}}}}}},"404":{"description":"Introuvable","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}}}}