{"components":{"schemas":{"ApiError":{"type":"object","title":"ApiError","required":["error"],"examples":[{"error":"checkout_not_found"}],"additionalProperties":false,"properties":{"error":{"type":"string"}}},"BadRequest":{"type":"object","title":"BadRequest","required":["details","error"],"examples":[{"details":[{"location":["subscription","currency"],"type":"no_match"}],"error":"Bad Request"}],"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"],"examples":[{"locale":"sv"}],"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"],"examples":[{"email":"anna.andersson@example.org","first_name":"Anna","id":"usr_5Kd8nQm2Rx7vTb3LpWz9Hc","last_name":"Andersson","locale":"sv","role":"admin"}],"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"],"examples":[{"error":"not_found"}],"additionalProperties":false,"properties":{"error":{"type":"string"}}},"PaymentSessionRequest":{"type":"object","description":"`request_type` says what the session sets up:\n\n- `subscription` (the default) sets up a subscription and the payment method that pays it, and needs a `subscription` object.\n- `payment_method` sets up an autogiro mandate only. It takes no amount or currency, and its webhooks return `subscription: null`.\n\n**Request type rules** — each is rejected with 422 and the given code:\n\n- `subscription_required`: a `subscription` request has no `subscription` object.\n- `subscription_not_allowed`: a `payment_method` request sends subscription data.\n- `payment_method_required`: a `payment_method` request names no method.\n- `payment_method_not_valid_for_request_type`: a `payment_method` request names a method other than `autogiro`.\n- `request_type_not_valid_for_period`: a `payment_method` request targets a checkout that is not recurring.\n\n**Checkout rules** — the currency and payment-method enums constrain only the format; each value must also be one the target checkout offers:\n\n- `currency_not_enabled`: the checkout does not offer the currency.\n- `payment_method_not_enabled`: the payment method is not enabled on the checkout.\n- `amount_below_minimum` (one-time checkout) or `invalid_subscription` (recurring checkout): the amount is below the checkout's minimum.\n- `amount_above_maximum`: the amount is above 99999999.99.\n\nEach `metadata` value is limited to 500 characters.\n\n**Deprecated:** top-level `amount` and `currency`, and `payment_method` as a bare string, are replaced by the `subscription` and `payment_method` objects. They still work and mean the same thing, but sending both forms of the amount is rejected with 422 `subscription_conflict`.\n","title":"PaymentSessionRequest","required":["cancel_url","success_url","checkout_id"],"examples":[{"cancel_url":"https://example.org/donate","checkout_id":"chk_0TMXp8QPR6yGvKuV2GZQ10","metadata":{"lead_id":"12345"},"payer":{"address_city":"Stockholm","address_country":"Sverige","address_street":"Storgatan 1","address_zip":"123 45","email":"anna.andersson@example.org","first_name":"Anna","last_name":"Andersson","phone_number":"+46701234567"},"payment_method":{"type":"autogiro"},"subscription":{"amount":200,"currency":"SEK"},"success_url":"https://example.org/donate/thank-you"}],"additionalProperties":false,"properties":{"amount":{"type":"number","deprecated":true},"cancel_url":{"type":"string","pattern":"^[Hh][Tt][Tt][Pp][Ss]?://(?:[^\\s/?#@]*@)?[^\\s/?#@]+(?:[/?#][^\\r\\n]*)?(?![\\s\\S])","examples":["https://example.org/donate"],"maxLength":2048},"checkout_id":{"type":"string","examples":["chk_0TMXp8QPR6yGvKuV2GZQ10"]},"currency":{"type":"string","enum":["SEK","EUR"],"deprecated":true},"metadata":{"type":"object","examples":[{"lead_id":"12345"}],"additionalProperties":true},"payer":{"type":"object","title":"PaymentSessionPayer","examples":[{"address_city":"Stockholm","address_country":"Sverige","address_street":"Storgatan 1","address_zip":"123 45","email":"anna.andersson@example.org","first_name":"Anna","last_name":"Andersson","phone_number":"+46701234567"}],"additionalProperties":false,"properties":{"address_city":{"type":"string","maxLength":500},"address_country":{"type":"string","maxLength":500},"address_street":{"type":"string","maxLength":500},"address_zip":{"type":"string","maxLength":500},"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":{"anyOf":[{"type":"object","title":"PaymentSessionPaymentMethod","required":["type"],"examples":[{"type":"autogiro"}],"additionalProperties":false,"properties":{"type":{"type":"string","enum":["autogiro","swish","swish_onetime","card","apple_pay","google_pay","sepa_direct_debit"]}}},{"type":"string","enum":["autogiro","swish","swish_onetime","card","apple_pay","google_pay","sepa_direct_debit"],"deprecated":true}]},"request_type":{"type":"string","enum":["subscription","payment_method"]},"subscription":{"type":"object","title":"PaymentSessionSubscription","required":["currency","amount"],"examples":[{"amount":200,"currency":"SEK"}],"additionalProperties":false,"properties":{"amount":{"type":"number"},"currency":{"type":"string","enum":["SEK","EUR"]}}},"success_url":{"type":"string","pattern":"^[Hh][Tt][Tt][Pp][Ss]?://(?:[^\\s/?#@]*@)?[^\\s/?#@]+(?:[/?#][^\\r\\n]*)?(?![\\s\\S])","examples":["https://example.org/donate/thank-you"],"maxLength":2048}}},"PaymentSessionResponse":{"type":"object","title":"PaymentSessionResponse","required":["short_code","session_token","payment_url"],"examples":[{"payment_url":"https://app.repejo.se/s/aunt123?rp_token=Xk7pQ2mRt9LwVb4nHs8c","session_token":"Xk7pQ2mRt9LwVb4nHs8c","short_code":"aunt123"}],"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"],"examples":[{"errors":{"detail":"Unauthorized"}}],"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/xml":{"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":"`request_type` says what the session sets up:\n\n- `subscription` (the default) sets up a subscription and the payment method that pays it, and needs a `subscription` object.\n- `payment_method` sets up an autogiro mandate only. It takes no amount or currency, and its webhooks return `subscription: null`.\n\n**Request type rules** — each is rejected with 422 and the given code:\n\n- `subscription_required`: a `subscription` request has no `subscription` object.\n- `subscription_not_allowed`: a `payment_method` request sends subscription data.\n- `payment_method_required`: a `payment_method` request names no method.\n- `payment_method_not_valid_for_request_type`: a `payment_method` request names a method other than `autogiro`.\n- `request_type_not_valid_for_period`: a `payment_method` request targets a checkout that is not recurring.\n\n**Checkout rules** — the currency and payment-method enums constrain only the format; each value must also be one the target checkout offers:\n\n- `currency_not_enabled`: the checkout does not offer the currency.\n- `payment_method_not_enabled`: the payment method is not enabled on the checkout.\n- `amount_below_minimum` (one-time checkout) or `invalid_subscription` (recurring checkout): the amount is below the checkout's minimum.\n- `amount_above_maximum`: the amount is above 99999999.99.\n\nEach `metadata` value is limited to 500 characters.\n\n**Deprecated:** top-level `amount` and `currency`, and `payment_method` as a bare string, are replaced by the `subscription` and `payment_method` objects. They still work and mean the same thing, but sending both forms of the amount is rejected with 422 `subscription_conflict`.\n","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/pdf":{"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/pdf":{"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":[]}]}