{"openapi":"3.0.3","info":{"title":"360Pay Partner API","version":"1.1.0","description":"API 360Pay compatible para clientes, cupones, liquidaciones y negocios afiliados. Acepta API key mediante x-api-key o Authorization: Bearer; cada operación conserva sus permisos y ámbito de negocio."},"servers":[{"url":"../../partners/v1","description":"Este servidor 360Pay"},{"url":"https://api.360pay.pe/partners/v1","description":"Producción"},{"url":"https://sandbox.api.360pay.pe/partners/v1","description":"Sandbox legacy"}],"paths":{"/businesses":{"get":{"operationId":"legacy_GET__partners_v1_businesses","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Business"}},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('businesses:read')"]},"post":{"operationId":"legacy_POST__partners_v1_businesses","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessCreateInput"}}}},"responses":{"201":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Business"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('businesses:write')"]}},"/businesses/{businessId}/hooks/{hookId}/rotate-secret":{"post":{"operationId":"legacy_POST__partners_v1_businesses_businessId_hooks_hookId_rotate_secret","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"businessId","in":"path","required":true,"schema":{"type":"string"}},{"name":"hookId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('businesses:write')"]}},"/businesses/{id}":{"patch":{"operationId":"legacy_PATCH__partners_v1_businesses_id_","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","message"],"properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('businesses:write')"]}},"/coupons":{"get":{"operationId":"legacy_GET__partners_v1_coupons","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('coupons:read')"]},"post":{"operationId":"legacy_POST__partners_v1_coupons","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponInput"}}}},"responses":{"201":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Coupon"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('coupons:write')"]}},"/coupons/metrics":{"get":{"operationId":"legacy_GET__partners_v1_coupons_metrics","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('coupons:read')"]}},"/coupons/import":{"post":{"operationId":"legacy_POST__partners_v1_coupons_import","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"type":"object"}},{"type":"object"}]}},"multipart/form-data":{"schema":{"type":"object","required":["file","business_id"],"properties":{"business_id":{"type":"string"},"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('coupons:import', 'coupons:write')"]}},"/coupons/{id}":{"get":{"operationId":"legacy_GET__partners_v1_coupons_id_","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Coupon"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('coupons:read')"]},"put":{"operationId":"legacy_PUT__partners_v1_coupons_id_","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponInput"}}}},"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Coupon"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('coupons:write')"]}},"/coupons/{id}/annul":{"put":{"operationId":"legacy_PUT__partners_v1_coupons_id_annul","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponInput"}}}},"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Coupon"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('coupons:delete', 'coupons:write')"]}},"/customers":{"get":{"operationId":"legacy_GET__partners_v1_customers","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('customers:read')"]},"post":{"operationId":"legacy_POST__partners_v1_customers","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInput"}}}},"responses":{"201":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Customer"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('customers:write')"]}},"/customers/search":{"get":{"operationId":"legacy_GET__partners_v1_customers_search","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('customers:read')"]}},"/customers/bulk-upsert":{"post":{"operationId":"legacy_POST__partners_v1_customers_bulk_upsert","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"type":"object"}},{"type":"object"}]}}}},"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('customers:bulk', 'customers:write')"]}},"/customers/bulk-delete":{"post":{"operationId":"legacy_POST__partners_v1_customers_bulk_delete","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"type":"object"}},{"type":"object"}]}}}},"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('customers:bulk', 'customers:delete')"]}},"/customers/{id}":{"get":{"operationId":"legacy_GET__partners_v1_customers_id_","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Customer"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('customers:read')"]},"put":{"operationId":"legacy_PUT__partners_v1_customers_id_","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInput"}}}},"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Customer"},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('customers:write')"]},"delete":{"operationId":"legacy_DELETE__partners_v1_customers_id_","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","message"],"properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('customers:delete')"]}},"/customers/{id}/coupons":{"get":{"operationId":"legacy_GET__partners_v1_customers_id_coupons","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('customers:read')"]}},"/settlements":{"get":{"operationId":"legacy_GET__partners_v1_settlements","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Settlement"}},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('settlements:read')"]}},"/settlements/{id}":{"get":{"operationId":"legacy_GET__partners_v1_settlements_id_","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Settlement"}},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('settlements:read')"]}},"/settlements/{id}/coupons":{"get":{"operationId":"legacy_GET__partners_v1_settlements_id_coupons","tags":["Partner integration"],"security":[{"BearerKey":[]},{"ApiKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"external_ref","in":"query","required":false,"schema":{"type":"string"}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"coupon_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_type","in":"query","required":false,"schema":{"type":"string"}},{"name":"document_number","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"business_id","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Legacy success envelope","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"message":{"type":"string"},"meta":{"type":"object","required":["total","page","limit","total_pages"],"properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"total_pages":{"type":"integer"}}}}}}}},"400":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-legacy-middleware":["requirePartnerScope('settlements:read')"]}}},"components":{"securitySchemes":{"BearerKey":{"type":"http","scheme":"bearer"},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"Customer":{"type":"object","properties":{"_id":{"nullable":true,"type":"string"},"business_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"document_type":{"type":"string"},"document_number":{"type":"string"},"dob":{"nullable":true,"type":"string"},"coupon_code":{"type":"string"},"payment_code":{"type":"string"},"account_status":{"type":"number"},"pending_coupons":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"}},"required":["_id","business_id","name","email","phone","document_type","document_number","dob","coupon_code","payment_code","account_status","pending_coupons","created_at","updated_at"]},"Coupon":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"customer_id":{"type":"string"},"coupon_code":{"type":"string"},"customer_name":{"type":"string"},"amount":{"type":"number"},"status":{"type":"string"},"description":{"type":"string"},"issue_date":{"type":"string"},"expiry_date":{"type":"string"},"payment_date":{"type":"string"},"paid_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"external_ref":{"type":"string"},"payment_reference":{"type":"string"},"settlement_id":{"type":"string"},"settlement_status":{"type":"string"},"settlement_date":{"type":"string"},"fee_platform":{"type":"number"},"fee_partner":{"type":"number"},"bank_tx_id":{"type":"string"}},"required":["_id","business_id","amount","status","payment_reference"],"additionalProperties":{}},"Settlement":{"type":"object","properties":{"_id":{"type":"string"},"business_id":{"type":"string"},"status":{"type":"string"},"coupons_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_amount":{"type":"number"},"commission_amount":{"type":"number"},"partner_fee_amount":{"type":"number"},"total_paid":{"type":"number"},"source_account":{"type":"string"},"destination_account":{"type":"string"},"destination_bank":{"type":"string"},"batch_id":{"type":"string"},"transaction_date":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","business_id","status","coupons_count","total_amount","commission_amount","total_paid","source_account","destination_account","destination_bank"],"additionalProperties":{}},"Ticket":{"type":"object","properties":{"ticket_id":{"type":"string"},"code":{"type":"string"},"external_ref":{"type":"string"},"status":{"type":"string"},"amount":{"type":"number"},"due_date":{"type":"string"},"paid_at":{"type":"string"},"bank_tx_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"cancelled_at":{"type":"string"}},"required":["status"]},"CustomerInput":{"type":"object","properties":{"name":{"type":"string"},"coupon_code":{"type":"string"},"business_id":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"phone_country_code":{"type":"string"},"document_type":{"type":"string"},"document_number":{"type":"string"},"dob":{"type":"string"}},"additionalProperties":{}},"CouponInput":{"type":"object","properties":{"business_id":{"type":"string"},"customer_id":{"type":"string"},"code":{"type":"string"},"coupon_code":{"type":"string"},"customer":{"type":"object","properties":{"name":{"type":"string"},"coupon_code":{"type":"string"},"business_id":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"phone_country_code":{"type":"string"},"document_type":{"type":"string"},"document_number":{"type":"string"},"dob":{"type":"string"}},"additionalProperties":{}},"customer_name":{"type":"string"},"name":{"type":"string"},"amount":{"anyOf":[{"type":"number"},{"type":"string"}]},"external_ref":{"type":"string"},"description":{"type":"string"},"expiry_date":{"type":"string"},"due_date":{"type":"string"},"issue_date":{"type":"string"},"ticket_date":{"type":"string"},"payment_date":{"type":"string"}},"additionalProperties":{}},"Business":{"type":"object"},"BusinessCreateInput":{"type":"object","properties":{"allow_shared_payment_prefix":{"description":"Approve a second, separate Business using PET, PLF or ZEN. Requires businesses:write and businesses:share_payment_prefix on both the Partner and its API key. Does not grant access to the existing Business or enable bank collection.","type":"boolean"},"business":{"type":"object","properties":{"name":{"type":"string","example":"Mi Empresa SAC"},"operating_country":{"type":"string","pattern":"^[A-Z]{2}$","example":"PE"},"email":{"type":"string","format":"email","example":"ops@miempresa.com"},"payment_prefix":{"type":"string","minLength":1,"maxLength":5,"pattern":"^[A-Za-z0-9]{1,5}$","example":"EMP"}},"additionalProperties":true,"required":["name"]},"config":{"type":"object","additionalProperties":true,"description":"Operational bank configuration. commission_fixed_amount and commission_tiers are reserved for Admin and rejected.","properties":{"source_account":{"type":"string"},"destination_account":{"type":"string"},"destination_bank":{"type":"string"}}},"hooks":{"description":"Webhooks que se crearán junto con el negocio. Si se envían hooks, la respuesta incluye hook_signing_secrets una sola vez para verificar firmas HMAC. Ver /docs/webhooks.","type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["PAYMENT_PAID","CASE_CREATED","CASE_TRANSITIONED","SETTLEMENT_CREATED","SETTLEMENT_STATUS_CHANGED"]},"url":{"type":"string","maxLength":2048},"headers":{"type":"object","additionalProperties":{"type":"string","maxLength":2048}},"include_unmapped_fields":{"type":"boolean"},"payload_mapping":{"type":"object","additionalProperties":{"type":"string","minLength":1,"maxLength":200},"description":"Mapa sourcePath → targetPath. Las rutas anidadas usan puntos; por ejemplo, `data.amount` → `payment.amount`."},"additional_fields":{"type":"object","additionalProperties":{}},"active":{"type":"boolean"}},"required":["type","url"],"additionalProperties":false}}},"required":["business","config"],"additionalProperties":{}},"Error":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"string"},"required_scopes":{"type":"array","items":{"type":"string"}}},"required":["success","error"],"additionalProperties":{}}}}}