{"components":{"schemas":{"ApiError":{"type":"object","title":"ApiError","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"string"}}},"BadRequest":{"type":"object","title":"BadRequest","required":["details","error"],"additionalProperties":false,"properties":{"details":{"type":"array","items":{"type":"object","required":["location","type"],"additionalProperties":false,"properties":{"location":{"type":"array","items":{"type":"string"}},"type":{"type":"string"}}}},"error":{"type":"string"}}},"LocaleUpdate":{"type":"object","title":"LocaleUpdate","required":["locale"],"additionalProperties":false,"properties":{"locale":{"type":"string","enum":["sv","fi","en"]}}},"Me":{"type":"object","description":"The authenticated user","title":"Me","required":["role","locale","id","email"],"additionalProperties":false,"properties":{"email":{"type":"string"},"first_name":{"type":"string"},"id":{"type":"string"},"last_name":{"type":"string"},"locale":{"type":"string"},"role":{"type":"string","enum":["admin","face_to_face","face_to_face_team_leader","face_to_face_admin","face_to_face_viewer","donor_service","telemarketer"]}}},"PaymentSessionRequest":{"type":"object","description":"The `currency` and `payment_method` enums constrain only the format; each value must also be one the target checkout offers. A `currency` the checkout does not offer is rejected with 422 `currency_not_enabled`, and a `payment_method` not enabled on it with 422 `payment_method_not_enabled`.","title":"PaymentSessionRequest","required":["cancel_url","success_url","checkout_id","currency","amount"],"additionalProperties":false,"properties":{"amount":{"type":"number"},"cancel_url":{"type":"string"},"checkout_id":{"type":"string"},"currency":{"type":"string","enum":["SEK","EUR"]},"metadata":{"type":"object","additionalProperties":true},"payer":{"type":"object","additionalProperties":false,"properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone_number":{"type":"string"}}},"payment_method":{"type":"string","enum":["autogiro","swish","swish_onetime","card","apple_pay","google_pay","sepa_direct_debit"]},"success_url":{"type":"string"}}},"PaymentSessionResponse":{"type":"object","title":"PaymentSessionResponse","required":["short_code","session_token","payment_url"],"additionalProperties":false,"properties":{"payment_url":{"type":"string"},"session_token":{"type":"string"},"short_code":{"type":"string"}}},"Unauthorized":{"type":"object","title":"Unauthorized","required":["errors"],"additionalProperties":false,"properties":{"errors":{"type":"object","required":["detail"],"additionalProperties":false,"properties":{"detail":{"type":"string"}}}}}},"securitySchemes":{"bearer_token":{"scheme":"bearer","type":"http","description":"Repejo API token"}}},"info":{"description":"Repejo's HTTP API.","title":"Repejo API","version":"0.1.0"},"openapi":"3.1.0","paths":{"/api/v1/me":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}},"description":"OK"}},"summary":"Get the authenticated user"}},"/api/v1/me/locale":{"put":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocaleUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}},"description":"OK"}},"summary":"Update the authenticated user's locale"}},"/api/v1/payment_session":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSessionRequest"}}},"description":"The `currency` and `payment_method` enums constrain only the format; each value must also be one the target checkout offers. A `currency` the checkout does not offer is rejected with 422 `currency_not_enabled`, and a `payment_method` not enabled on it with 422 `payment_method_not_enabled`.","required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSessionResponse"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequest"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Unprocessable Entity"}},"summary":"Create a payment session"}}},"security":[{"bearer_token":[]}]}