{"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","en","fi","de"]}}},"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"]}}},"NotFound":{"type":"object","title":"NotFound","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"string"}}},"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`. `amount` must be at least the checkout's minimum — rejected with 422 `amount_below_minimum` on a one-time checkout and 422 `invalid_subscription` on a recurring one — and at most 99999999.99 (422 `amount_above_maximum`). Each `metadata` value is limited to 500 characters.","title":"PaymentSessionRequest","required":["cancel_url","success_url","checkout_id","currency","amount"],"additionalProperties":false,"properties":{"amount":{"type":"number"},"cancel_url":{"type":"string","pattern":"^[Hh][Tt][Tt][Pp][Ss]?://(?:[^\\s/?#@]*@)?[^\\s/?#@]+(?:[/?#][^\\r\\n]*)?(?![\\s\\S])","maxLength":2048},"checkout_id":{"type":"string"},"currency":{"type":"string","enum":["SEK","EUR"]},"metadata":{"type":"object","additionalProperties":true},"payer":{"type":"object","additionalProperties":false,"properties":{"email":{"type":"string","maxLength":254},"first_name":{"type":"string","maxLength":500},"last_name":{"type":"string","maxLength":500},"phone_number":{"type":"string","maxLength":32}}},"payment_method":{"type":"string","enum":["autogiro","swish","swish_onetime","card","apple_pay","google_pay","sepa_direct_debit"]},"success_url":{"type":"string","pattern":"^[Hh][Tt][Tt][Pp][Ss]?://(?:[^\\s/?#@]*@)?[^\\s/?#@]+(?:[/?#][^\\r\\n]*)?(?![\\s\\S])","maxLength":2048}}},"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"}}},"String":{"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/mandates/{id}/signature_xml":{"get":{"description":"The BankID signature envelope for a mandate signed in a checkout. Mandates signed on paper, imported, or drawn by hand have none and respond 404. Responds with `application/xml` bytes.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"OK"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Not Found"}},"summary":"Download the BankID signature XML"}},"/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`. `amount` must be at least the checkout's minimum — rejected with 422 `amount_below_minimum` on a one-time checkout and 422 `invalid_subscription` on a recurring one — and at most 99999999.99 (422 `amount_above_maximum`). Each `metadata` value is limited to 500 characters.","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"}},"/api/v1/subscriptions/{id}/mandate_pdf_masked":{"get":{"description":"The donor-facing copy of the signed mandate, with account number and personal identity number redacted. Responds with `application/pdf` bytes.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"OK"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Internal Server Error"}},"summary":"Download the masked mandate PDF"}},"/api/v1/subscriptions/{id}/mandate_pdf_unmasked":{"get":{"description":"The organisation's copy of the signed mandate with full account details. Responds with `application/pdf` bytes.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"OK"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unauthorized"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Internal Server Error"}},"summary":"Download the unmasked mandate PDF"}}},"security":[{"bearer_token":[]}]}