{"components":{"schemas":{"ApiError":{"type":"object","title":"ApiError","required":["error"],"examples":[{"error":"checkout_not_found"}],"properties":{"error":{"type":"string"}},"additionalProperties":false},"BadRequest":{"type":"object","title":"BadRequest","required":["details","error"],"examples":[{"details":[{"location":["subscription","currency"],"type":"type_mismatch"}],"error":"Bad Request"}],"properties":{"details":{"type":"array","items":{"type":"object","required":["location","type"],"properties":{"location":{"type":"array","items":{"type":"string"}},"type":{"type":"string"}},"additionalProperties":false}},"error":{"type":"string"}},"additionalProperties":false},"LocaleUpdate":{"type":"object","title":"LocaleUpdate","required":["locale"],"examples":[{"locale":"sv"}],"properties":{"locale":{"type":"string","enum":["sv","en","fi","de"]}},"additionalProperties":false},"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"}],"properties":{"email":{"type":"string"},"first_name":{"type":["string","null"]},"id":{"type":"string"},"last_name":{"type":["string","null"]},"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"]}},"additionalProperties":false},"NotFound":{"type":"object","title":"NotFound","required":["error"],"examples":[{"error":"not_found"}],"properties":{"error":{"type":"string"}},"additionalProperties":false},"PayerCreated":{"type":"object","title":"PayerCreated","required":["sent_at","event_type","data"],"properties":{"data":{"type":"object","title":"Payer","required":["updated_at","tracking","status","reference_value","reference_title","preferred_locale","phone_number","personal_identity_number_country","personal_identity_number","payment_method","payer_type","organisation_number","note","name","metadata","last_name","inserted_at","id","first_name","external_id","email","contact_consent_phone","contact_consent","company_name","checkout_id","anonymized_at","address_zip","address_street","address_country","address_city"],"properties":{"address_city":{"type":["string","null"]},"address_country":{"type":["string","null"]},"address_street":{"type":["string","null"]},"address_zip":{"type":["string","null"]},"anonymized_at":{"type":["string","null"],"format":"date-time"},"checkout_id":{"type":["string","null"],"pattern":"^chk_"},"company_name":{"type":["string","null"]},"contact_consent":{"type":["boolean","null"]},"contact_consent_phone":{"type":["boolean","null"]},"email":{"type":["string","null"]},"external_id":{"type":["string","null"]},"first_name":{"type":["string","null"]},"id":{"type":"string","pattern":"^pay_"},"inserted_at":{"type":"string","description":"Naive timestamp without timezone","pattern":"^-?\\d{4,}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","examples":["2026-05-12T13:46:10"]},"last_name":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"name":{"type":["string","null"]},"note":{"type":"string"},"organisation_number":{"type":["string","null"]},"payer_type":{"type":"string","enum":["private","company"]},"payment_method":{"type":"string","enum":["swish","autogiro","card","apple_pay","google_pay","stripe_subscription","sepa_direct_debit","offline","invoice","mobile_pay","none"]},"personal_identity_number":{"type":["string","null"]},"personal_identity_number_country":{"anyOf":[{"type":"string","enum":["sweden","finland","germany","norway"],"deprecated":true,"description":"Read the method from the transaction or subscription."},{"type":"null"}]},"phone_number":{"type":["string","null"]},"preferred_locale":{"type":["string","null"]},"reference_title":{"type":["string","null"]},"reference_value":{"type":["string","null"]},"status":{"type":"string","enum":["active","pending","rejected","terminated","aborted","checkout","completed","petition_signer","p2p_creator","deleted","archived"]},"tracking":{"type":"object","additionalProperties":{"type":"string"}},"updated_at":{"type":"string","description":"Naive timestamp without timezone","pattern":"^-?\\d{4,}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","examples":["2026-05-12T13:46:10"]}},"additionalProperties":false},"event_type":{"enum":["payer.created"]},"sent_at":{"type":"string","format":"date-time"}},"additionalProperties":false},"PayerUpdated":{"type":"object","title":"PayerUpdated","required":["sent_at","event_type","data"],"properties":{"data":{"type":"object","title":"Payer","required":["updated_at","tracking","status","reference_value","reference_title","preferred_locale","phone_number","personal_identity_number_country","personal_identity_number","payment_method","payer_type","organisation_number","note","name","metadata","last_name","inserted_at","id","first_name","external_id","email","contact_consent_phone","contact_consent","company_name","checkout_id","anonymized_at","address_zip","address_street","address_country","address_city"],"properties":{"address_city":{"type":["string","null"]},"address_country":{"type":["string","null"]},"address_street":{"type":["string","null"]},"address_zip":{"type":["string","null"]},"anonymized_at":{"type":["string","null"],"format":"date-time"},"checkout_id":{"type":["string","null"],"pattern":"^chk_"},"company_name":{"type":["string","null"]},"contact_consent":{"type":["boolean","null"]},"contact_consent_phone":{"type":["boolean","null"]},"email":{"type":["string","null"]},"external_id":{"type":["string","null"]},"first_name":{"type":["string","null"]},"id":{"type":"string","pattern":"^pay_"},"inserted_at":{"type":"string","description":"Naive timestamp without timezone","pattern":"^-?\\d{4,}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","examples":["2026-05-12T13:46:10"]},"last_name":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"name":{"type":["string","null"]},"note":{"type":"string"},"organisation_number":{"type":["string","null"]},"payer_type":{"type":"string","enum":["private","company"]},"payment_method":{"type":"string","enum":["swish","autogiro","card","apple_pay","google_pay","stripe_subscription","sepa_direct_debit","offline","invoice","mobile_pay","none"]},"personal_identity_number":{"type":["string","null"]},"personal_identity_number_country":{"anyOf":[{"type":"string","enum":["sweden","finland","germany","norway"],"deprecated":true,"description":"Read the method from the transaction or subscription."},{"type":"null"}]},"phone_number":{"type":["string","null"]},"preferred_locale":{"type":["string","null"]},"reference_title":{"type":["string","null"]},"reference_value":{"type":["string","null"]},"status":{"type":"string","enum":["active","pending","rejected","terminated","aborted","checkout","completed","petition_signer","p2p_creator","deleted","archived"]},"tracking":{"type":"object","additionalProperties":{"type":"string"}},"updated_at":{"type":"string","description":"Naive timestamp without timezone","pattern":"^-?\\d{4,}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$","examples":["2026-05-12T13:46:10"]}},"additionalProperties":false},"event_type":{"enum":["payer.updated"]},"sent_at":{"type":"string","format":"date-time"}},"additionalProperties":false},"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- `account_entry_not_supported`: `payment_method.account_entry` is sent with a method other than `autogiro`, or on a `payment_method` request.\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 zero or less, or 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`merchant_reference` is sent to Adyen as the reference of the first payment when the donor pays through your organisation's Adyen account. Repejo does not require it to be unique. A value that is empty or longer than 80 characters after trimming is rejected with 422 `invalid_merchant_reference`. Without it, Adyen shows `<organisation_id>.<user_session_id>`.\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"}],"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},"merchant_reference":{"type":"string","description":"Your own reference for the payment, 1 to 80 characters after trimming. Adyen shows it as the payment's `merchantReference`.","examples":["BEEST-2026-000123"]},"metadata":{"type":"object","examples":[{"lead_id":"12345"}],"additionalProperties":{"type":"string","maxLength":500}},"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"}],"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}},"additionalProperties":false},"payment_method":{"anyOf":[{"type":"object","title":"PaymentSessionPaymentMethod","required":["type"],"examples":[{"type":"autogiro"}],"properties":{"account_entry":{"enum":["bank_account_selection"],"description":"How the donor gives their bank account. `bank_account_selection` opens Brite's bank account selection as soon as the checkout loads, instead of the Autogiro form. Only with `type: autogiro` on a `subscription` request; anything else is rejected with 422 `account_entry_not_supported`. Without it the donor sees the Autogiro form."},"type":{"type":"string","enum":["autogiro","swish","swish_onetime","card","apple_pay","google_pay","sepa_direct_debit","mobile_pay"]}},"additionalProperties":false},{"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"}],"properties":{"amount":{"type":"number"},"currency":{"type":"string","enum":["SEK","EUR"]}},"additionalProperties":false},"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}},"additionalProperties":false},"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"}],"properties":{"payment_url":{"type":"string"},"session_token":{"type":"string"},"short_code":{"type":"string"}},"additionalProperties":false},"String":{"type":"string"},"Unauthorized":{"type":"object","title":"Unauthorized","required":["errors"],"examples":[{"errors":{"detail":"Unauthorized"}}],"properties":{"errors":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false}},"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}/mandate_pdf_masked":{"get":{"description":"For a mandate signed without a subscription (`request_type: payment_method`): the donor-facing copy, without amount, periodicity and debit date, 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 of a mandate"}},"/api/v1/mandates/{id}/mandate_pdf_unmasked":{"get":{"description":"For a mandate signed without a subscription (`request_type: payment_method`): the organisation's copy with full account details, without amount, periodicity and debit date. 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 of a mandate"}},"/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- `account_entry_not_supported`: `payment_method.account_entry` is sent with a method other than `autogiro`, or on a `payment_method` request.\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 zero or less, or 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`merchant_reference` is sent to Adyen as the reference of the first payment when the donor pays through your organisation's Adyen account. Repejo does not require it to be unique. A value that is empty or longer than 80 characters after trimming is rejected with 422 `invalid_merchant_reference`. Without it, Adyen shows `<organisation_id>.<user_session_id>`.\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":[]}],"webhooks":{"payer.created":{"post":{"parameters":[{"description":"HMAC-SHA256 of the raw body with the endpoint's secret key","in":"header","name":"repejo-signature","required":true,"schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"}},{"description":"1 on the first try, one higher on each automatic retry","in":"header","name":"x-repejo-attempt","required":true,"schema":{"type":"integer","minimum":1}},{"in":"header","name":"x-repejo-event-type","required":true,"schema":{"type":"string"}},{"description":"Same across retries and resends. Deduplicate on this","in":"header","name":"x-repejo-event-id","required":true,"schema":{"type":"string"}},{"description":"Same across the automatic retries of one delivery, new for a resend","in":"header","name":"x-repejo-delivery-id","required":true,"schema":{"type":"string"}},{"in":"header","name":"user-agent","required":true,"schema":{"enum":["Repejo-Webhooks/1.0"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayerCreated"}}},"required":true},"responses":{"2XX":{"description":"Acknowledges the delivery. Any other response is retried"}},"security":[],"summary":"Sent when a payer is created"}},"payer.updated":{"post":{"parameters":[{"description":"HMAC-SHA256 of the raw body with the endpoint's secret key","in":"header","name":"repejo-signature","required":true,"schema":{"type":"string","pattern":"^sha256=[0-9a-f]{64}$"}},{"description":"1 on the first try, one higher on each automatic retry","in":"header","name":"x-repejo-attempt","required":true,"schema":{"type":"integer","minimum":1}},{"in":"header","name":"x-repejo-event-type","required":true,"schema":{"type":"string"}},{"description":"Same across retries and resends. Deduplicate on this","in":"header","name":"x-repejo-event-id","required":true,"schema":{"type":"string"}},{"description":"Same across the automatic retries of one delivery, new for a resend","in":"header","name":"x-repejo-delivery-id","required":true,"schema":{"type":"string"}},{"in":"header","name":"user-agent","required":true,"schema":{"enum":["Repejo-Webhooks/1.0"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayerUpdated"}}},"required":true},"responses":{"2XX":{"description":"Acknowledges the delivery. Any other response is retried"}},"security":[],"summary":"Sent when a payer is updated or anonymized"}}}}