{"openapi":"3.0.3","info":{"title":"Payme integration API","version":"1.0.0","description":"# Integrate your system\n\nBase URL: `https://payme.com.ua/api/v1`.\n\n## Create a service token\n\nSign in to Payme, save an email address in your profile, and open **Profile → API** (`/profile/API`). Create a token for each integration, choose its access level, and copy the token shown after creation. Store it on your server: you cannot view it again after leaving the page. If you lose it, create a replacement and revoke the old token.\n\nChoose an expiration period: `30_days`, `60_days`, `90_days`, `1_year`, or `never`. Changing the expiration starts a new period from the time you save the change. Expired or revoked tokens cannot be reactivated.\n\n## API request rules\n\n### Authorization\n\nSend requests over HTTPS with your service token in the `Authorization: Bearer <token>` header. Each endpoint below lists the required access: `read` allows reading, while `read_write` allows both reading and writing. A token can access only your account’s resources. Cookies and URL parameters cannot replace the authorization header. Manage tokens and webhooks in **Profile → API**.\n\n### Additional headers\n\nFor requests with a JSON body, send `Content-Type: application/json`. When creating a link or template, you can also send `Idempotency-Key` to safely retry a request (see below).\n\nWe recommend `X-Payme-Client` to identify your integration and version, for example `acme-crm/1.2`. This header is optional. Use 1–64 ASCII letters, digits, dots, underscores, slashes, spaces or hyphens, starting with a letter or digit. Do not include personal information or secrets. An invalid value returns 400.\n\n```sh\ncurl --fail-with-body 'https://payme.com.ua/api/v1/links?limit=20' \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H 'X-Payme-Client: acme-crm/1.2'\n```\n\n### Request bodies\n\nSend one JSON object using the fields documented for the endpoint. Unknown fields and bodies larger than 65,536 UTF-8 bytes are rejected. Write payment amounts as decimal strings, such as `\"123.45\"`, rather than JSON numbers.\n\n## Quotas\n\nAll tokens in your account share the same limits. Read requests can run continuously at **1,000 requests per minute**, with up to **100 requests at once** after an idle period. Write requests can run continuously at **100 requests per minute**, with up to **10 requests at once**.\n\nRequests become available gradually: one read request every 60 milliseconds and one write request every 600 milliseconds. The allowance does not reset at the start of each minute. Authenticated requests that return errors and repeated requests also count. If you receive 429, wait the number of seconds specified in `Retry-After` before trying again.\n\n## Pagination, retries and errors\n\nList endpoints return 20 items by default, or up to 100 when you set `limit`. Results appear newest first. To fetch the next page, pass the returned `next_cursor` as `cursor`, keeping the same filters. Do not modify the cursor. A null `next_cursor` means there are no more results.\n\nWhen creating a link or template, use a unique `Idempotency-Key` of up to 128 characters. If the connection fails before you receive a response, repeat the same request with the same key. Within 24 hours, Payme returns the original status and body instead of creating a duplicate. Reusing the key with different details returns 409.\n\nErrors contain a code, a message, a request ID and, when available, field errors. For example:\n\n```json\n{\n  \"error\": {\n    \"code\": \"validation_error\",\n    \"message\": \"Invalid payment details\"\n  },\n  \"request_id\": \"req_example\"\n}\n```\n\n`X-Request-ID` identifies the current request. Check the error code before retrying; invalid input or insufficient access requires a correction rather than another identical request.\n\n## QR images\n\nDownload a saved link’s QR as PNG or JPEG, with a square size from 128 to 1024 pixels (default: 512). For a complete IBAN payment, the QR opens the payment details in a compatible banking app. For card payments or details that the payer still needs to fill in, it opens the Payme payment page instead. `X-Payme-QR-Mode` identifies the result: `iban`, `payment_page`, or `legacy_iban` for older IBAN links.\n\nTo generate an IBAN QR without creating a link, use `/qr/iban` with complete payment details and a purpose containing no placeholders.\n\n## CORS\n\nCross-origin browser requests are disabled by default for each account. In **Profile → API → Browser access (CORS)**, save up to 20 exact HTTPS origins, one per line (for example, `https://crm.example.com`). Do not include paths, wildcards or credentials. This list applies to all API tokens in your account; clear it to disable browser access. Changes apply to actual requests immediately.\n\nPreflight requests do not carry a token. Passing a preflight does not grant access: each actual request must use a valid bearer token whose owner has allowed that origin. Cookie credentials are not supported. Keep service tokens on your server: a token embedded in public JavaScript is visible to visitors.\n\n## Webhooks\n\nWebhooks notify your system when an event occurs in Payme. In **Profile → API**, add a public HTTPS URL, choose an event, and enable the destination. Copy the signing key shown after creation and store it on your server.\n\nCurrently available events:\n\n- `payment_request.marked_paid`: a payment link was marked paid through Payme or the API. This is a reported payment status, not confirmation from a bank.\n\nPayme sends an HTTPS POST with a JSON event. Deliveries may arrive more than once or out of order. Use the event’s `id` to avoid processing it twice, and check `schema_version` before processing its data. Return a 2xx status to acknowledge receipt, including duplicate events. Network errors and 408, 429 or 5xx responses are retried for up to 72 hours; other 4xx responses stop delivery. Your endpoint should respond within 10 seconds.\n\n### Verify a webhook signature\n\nVerify the original request body bytes before parsing JSON. Decode the base64url signing key, then calculate HMAC-SHA256 over `X-Payme-Timestamp`, a dot (`.`), and the raw body. Compare `v1=` followed by the lowercase hexadecimal digest with `X-Payme-Signature` using a constant-time comparison. Reject timestamps more than 300 seconds in the past or future. Confirm that `X-Payme-Event-ID` matches the event’s `id`.\n\n`X-Payme-Key-Version` identifies the signing key version. After rotating a key, keep the previous key available for pending deliveries. The Python example below verifies the signature and event ID. In your handler, pass the raw body bytes and request headers, then deduplicate the verified event ID before applying business changes.\n\n## Verification example (Python)\n\n```python\n\"\"\"Verify exact bytes before JSON parsing; persist deduplication before side effects.\"\"\"\nimport base64\nimport hashlib\nimport hmac\nimport json\nimport re\nimport time\n\n\ndef verify(body, headers, secret, now=None):\n    timestamp = headers.get(\"X-Payme-Timestamp\", \"\")\n    signature = headers.get(\"X-Payme-Signature\", \"\")\n    event_id = headers.get(\"X-Payme-Event-ID\", \"\")\n    if not re.fullmatch(r\"[0-9]{1,12}\", timestamp):\n        raise ValueError(\"invalid timestamp\")\n    if not re.fullmatch(r\"v1=[0-9a-f]{64}\", signature):\n        raise ValueError(\"invalid signature\")\n    if abs((time.time() if now is None else now) - int(timestamp)) > 300:\n        raise ValueError(\"outside replay window\")\n    if not re.fullmatch(r\"[A-Za-z0-9_-]{43}\", secret):\n        raise ValueError(\"invalid signing key\")\n    key = base64.urlsafe_b64decode(secret + \"=\")\n    expected = \"v1=\" + hmac.new(key, timestamp.encode(\"ascii\") + b\".\" + body, hashlib.sha256).hexdigest()\n    if not hmac.compare_digest(expected, signature):\n        raise ValueError(\"signature mismatch\")\n    event = json.loads(body)\n    if not event_id or event.get(\"id\") != event_id:\n        raise ValueError(\"event ID mismatch\")\n    return event\n\n```\n\nVerification test data:\n\n```json\n{\n  \"secretBase64url\": \"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8\",\n  \"timestamp\": \"1791892800\",\n  \"body\": \"{\\\"id\\\":\\\"event_test\\\",\\\"type\\\":\\\"payment_request.marked_paid\\\",\\\"schema_version\\\":1,\\\"occurred_at\\\":\\\"2026-10-13T12:00:00Z\\\",\\\"request_id\\\":\\\"req_test\\\",\\\"data\\\":{\\\"link_id\\\":\\\"link_test\\\",\\\"template_id\\\":null,\\\"order_number\\\":\\\"INV-1\\\",\\\"amount\\\":\\\"123.45\\\",\\\"paid_at\\\":\\\"2026-10-13T12:00:00Z\\\",\\\"source\\\":\\\"api\\\"}}\",\n  \"signature\": \"v1=7694efa202628c73c035fa58de589f0e1721b87345c5d0d1a96b704247e02dfc\"\n}\n```\n"},"servers":[{"url":"https://payme.com.ua/api/v1"}],"security":[{"serviceToken":[]}],"tags":[{"name":"Links"},{"name":"Templates"},{"name":"QR"}],"paths":{"/links":{"get":{"operationId":"listLinks","summary":"List payment links","description":"List your links, newest first. Filter by payment or archive status. Archived links are excluded by default.\n\nRequired token access: `read` or `read_write`.","tags":["Links"],"x-payme-scope":"read","x-payme-quota":"read","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Paid"},{"$ref":"#/components/parameters/Archived"}],"responses":{"200":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkPage"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"405":{"$ref":"#/components/responses/405"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X GET \"https://payme.com.ua/api/v1/links?limit=20\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\""}]},"post":{"operationId":"createLink","summary":"Create a payment link","description":"Create a shareable payment page with the supplied payment details. Choose IBAN or card payment. Details cannot be edited after creation; create a new link to change them. An optional template_id associates the link with one of your templates; provide all payment details in the request. Later template changes do not change this link.\n\nRequired token access: `read_write`.","tags":["Links"],"x-payme-scope":"read_write","x-payme-quota":"write","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Idempotency"}],"responses":{"201":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Link"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"405":{"$ref":"#/components/responses/405"},"409":{"$ref":"#/components/responses/409"},"413":{"$ref":"#/components/responses/413"},"415":{"$ref":"#/components/responses/415"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"requestBody":{"required":true,"description":"JSON request body. Maximum size: 65,536 UTF-8 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLinkRequest"},"examples":{"iban":{"summary":"IBAN payment","value":{"payment_type":"iban","amount":"123.45","purpose":"Invoice INV-1","payment_category":"services","receiver_name":"Example company","iban":"UA123052990000026007233566001","edrpou":"12345678"}},"card":{"summary":"Card payment","value":{"payment_type":"card","amount":"123.45","purpose":"Invoice INV-1","card_receiver_name":"Example recipient","card_number":"4111111111111111"}},"purpose_fields":{"summary":"IBAN payment with a payer field","value":{"payment_type":"iban","amount":"123.45","purpose":"Payment for order {order}","receiver_name":"Example company","iban":"UA123052990000026007233566001","edrpou":"12345678","purpose_fields":[{"name":"order","label":"Order number","hint":"Enter your order number","filled_by":"payer"}]}}}}}},"x-codeSamples":[{"lang":"Shell","label":"Card payment","source":"curl --fail-with-body -X POST \"https://payme.com.ua/api/v1/links\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\" \\\n  -H \"Content-Type: application/json\" \\\n  --data-raw '{\"payment_type\":\"card\",\"amount\":\"12.34\",\"purpose\":\"Invoice\",\"card_number\":\"4111111111111111\",\"card_receiver_name\":\"Synthetic recipient\"}' \\\n  -H \"Idempotency-Key: synthetic-invoice-1\""},{"lang":"Shell","label":"IBAN payment","source":"curl --fail-with-body -X POST \"https://payme.com.ua/api/v1/links\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  --data-raw '{\"payment_type\": \"iban\", \"amount\": \"123.45\", \"purpose\": \"Invoice INV-1\", \"payment_category\": \"services\", \"receiver_name\": \"Example company\", \"iban\": \"UA123052990000026007233566001\", \"edrpou\": \"12345678\"}'"},{"lang":"Shell","label":"IBAN payment with a payer field","source":"curl --fail-with-body -X POST \"https://payme.com.ua/api/v1/links\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  --data-raw '{\"payment_type\": \"iban\", \"amount\": \"123.45\", \"purpose\": \"Payment for order {order}\", \"receiver_name\": \"Example company\", \"iban\": \"UA123052990000026007233566001\", \"edrpou\": \"12345678\", \"purpose_fields\": [{\"name\": \"order\", \"label\": \"Order number\", \"hint\": \"Enter your order number\", \"filled_by\": \"payer\"}]}'"}]}},"/links/{id}":{"get":{"operationId":"getLink","summary":"Read a payment link","description":"Get the details and status of one of your payment links, including archived links.\n\nRequired token access: `read` or `read_write`.","tags":["Links"],"x-payme-scope":"read","x-payme-quota":"read","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Link"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"405":{"$ref":"#/components/responses/405"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X GET \"https://payme.com.ua/api/v1/links/RESOURCE_ID\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\""}]},"delete":{"operationId":"archiveLink","summary":"Archive a payment link","description":"Archive a link without deleting its details or payment history. Archiving an already archived link also succeeds.\n\nRequired token access: `read_write`.","tags":["Links"],"x-payme-scope":"read_write","x-payme-quota":"write","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Id"}],"responses":{"204":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"405":{"$ref":"#/components/responses/405"},"409":{"$ref":"#/components/responses/409"},"413":{"$ref":"#/components/responses/413"},"415":{"$ref":"#/components/responses/415"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X DELETE \"https://payme.com.ua/api/v1/links/RESOURCE_ID\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\""}]}},"/links/{id}/mark-paid":{"post":{"operationId":"markLinkPaid","summary":"Report a link as paid","description":"Mark a link as paid and notify enabled webhook destinations. This reports payment status; it does not confirm a bank transfer. Repeating the request returns the existing status without sending another event. Archived links return 409.\n\nRequired token access: `read_write`.","tags":["Links"],"x-payme-scope":"read_write","x-payme-quota":"write","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Link"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"405":{"$ref":"#/components/responses/405"},"409":{"$ref":"#/components/responses/409"},"413":{"$ref":"#/components/responses/413"},"415":{"$ref":"#/components/responses/415"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X POST \"https://payme.com.ua/api/v1/links/RESOURCE_ID/mark-paid\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\""}]}},"/links/{id}/qr":{"get":{"operationId":"getLinkQR","summary":"Download a payment QR image","description":"Download a PNG or JPEG QR image for your payment link. Complete IBAN details open a payment in a compatible banking app. Card payments and payments with fields the payer must complete open the Payme payment page. Use format and size to choose the image format and dimensions.\n\nRequired token access: `read` or `read_write`.","tags":["QR"],"x-payme-scope":"read","x-payme-quota":"read","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Id"},{"$ref":"#/components/parameters/Format"},{"$ref":"#/components/parameters/Size"}],"responses":{"200":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"},"X-Payme-QR-Mode":{"$ref":"#/components/headers/X-Payme-QR-Mode"},"Cache-Control":{"description":"Images are not cached.","schema":{"type":"string","enum":["no-store"]}}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"405":{"$ref":"#/components/responses/405"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X GET \"https://payme.com.ua/api/v1/links/RESOURCE_ID/qr?format=png&size=512\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\" \\\n  --output payment.png"}]}},"/templates":{"get":{"operationId":"listTemplates","summary":"List payment templates","description":"List your reusable templates, newest first. Use the cursor to fetch the next page.\n\nRequired token access: `read` or `read_write`.","tags":["Templates"],"x-payme-scope":"read","x-payme-quota":"read","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplatePage"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"405":{"$ref":"#/components/responses/405"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X GET \"https://payme.com.ua/api/v1/templates?limit=20\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\""}]},"post":{"operationId":"createTemplate","summary":"Create a payment template","description":"Save reusable payment details under a name. A template can leave the amount empty so you can set it when creating a link.\n\nRequired token access: `read_write`.","tags":["Templates"],"x-payme-scope":"read_write","x-payme-quota":"write","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Idempotency"}],"responses":{"201":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"405":{"$ref":"#/components/responses/405"},"409":{"$ref":"#/components/responses/409"},"413":{"$ref":"#/components/responses/413"},"415":{"$ref":"#/components/responses/415"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"requestBody":{"required":true,"description":"JSON request body. Maximum size: 65,536 UTF-8 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateRequest"}}}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X POST \"https://payme.com.ua/api/v1/templates\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\" \\\n  -H \"Content-Type: application/json\" \\\n  --data-raw '{\"name\":\"Synthetic invoice\",\"payment_details\":{\"payment_type\":\"card\",\"amount\":\"12.34\",\"purpose\":\"Invoice\",\"card_number\":\"4111111111111111\",\"card_receiver_name\":\"Synthetic recipient\"}}' \\\n  -H \"Idempotency-Key: synthetic-invoice-1\""}]}},"/templates/{id}":{"get":{"operationId":"getTemplate","summary":"Read a payment template","description":"Get the name and payment details of one of your templates.\n\nRequired token access: `read` or `read_write`.","tags":["Templates"],"x-payme-scope":"read","x-payme-quota":"read","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"405":{"$ref":"#/components/responses/405"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X GET \"https://payme.com.ua/api/v1/templates/RESOURCE_ID\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\""}]},"patch":{"operationId":"updateTemplate","summary":"Edit a payment template","description":"Update name, payment_details, or both. If you send payment_details, provide the complete replacement object. Existing payment links keep their original details.\n\nRequired token access: `read_write`.","tags":["Templates"],"x-payme-scope":"read_write","x-payme-quota":"write","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"405":{"$ref":"#/components/responses/405"},"409":{"$ref":"#/components/responses/409"},"413":{"$ref":"#/components/responses/413"},"415":{"$ref":"#/components/responses/415"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"requestBody":{"required":true,"description":"JSON request body. Maximum size: 65,536 UTF-8 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTemplateRequest"}}}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X PATCH \"https://payme.com.ua/api/v1/templates/RESOURCE_ID\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\" \\\n  -H \"Content-Type: application/json\" \\\n  --data-raw '{\"name\":\"Synthetic updated invoice\"}'"}]},"delete":{"operationId":"deleteTemplate","summary":"Delete a payment template","description":"Delete a template. Links created from it remain available with their original details. Deleting a missing template returns 404.\n\nRequired token access: `read_write`.","tags":["Templates"],"x-payme-scope":"read_write","x-payme-quota":"write","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Id"}],"responses":{"204":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"405":{"$ref":"#/components/responses/405"},"409":{"$ref":"#/components/responses/409"},"413":{"$ref":"#/components/responses/413"},"415":{"$ref":"#/components/responses/415"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X DELETE \"https://payme.com.ua/api/v1/templates/RESOURCE_ID\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\""}]}},"/qr/iban":{"post":{"operationId":"createIBANQR","summary":"Generate an IBAN QR image","description":"Generate a PNG or JPEG QR for a Ukrainian IBAN payment without creating a payment link. Supply complete recipient details, amount, reference and purpose without placeholders. A compatible banking app can read the QR to prepare the transfer.\n\nRequired token access: `read_write`.","tags":["QR"],"x-payme-scope":"read_write","x-payme-quota":"write","parameters":[{"$ref":"#/components/parameters/Client"},{"$ref":"#/components/parameters/Format"},{"$ref":"#/components/parameters/Size"}],"responses":{"200":{"description":"Success.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"},"X-Payme-QR-Mode":{"$ref":"#/components/headers/X-Payme-QR-Mode"},"Cache-Control":{"description":"Images are not cached.","schema":{"type":"string","enum":["no-store"]}}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"405":{"$ref":"#/components/responses/405"},"409":{"$ref":"#/components/responses/409"},"413":{"$ref":"#/components/responses/413"},"415":{"$ref":"#/components/responses/415"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}},"requestBody":{"required":true,"description":"JSON request body. Maximum size: 65,536 UTF-8 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBANQRRequest"}}}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl --fail-with-body -X POST \"https://payme.com.ua/api/v1/qr/iban?format=png&size=512\" \\\n  -H \"Authorization: Bearer $PAYME_TOKEN\" \\\n  -H \"X-Payme-Client: acme-crm/1.2\" \\\n  -H \"Content-Type: application/json\" \\\n  --data-raw '{\"recipient\":\"PayMe\",\"iban\":\"UA213223130000026007233566001\",\"recipient_code\":\"12345678\",\"amount\":\"3.00\",\"purpose\":\"Invoice\",\"reference\":\"INV-1\"}' \\\n  --output payment.png"}]}}},"components":{"securitySchemes":{"serviceToken":{"type":"http","scheme":"bearer","bearerFormat":"Payme service token","description":"Opaque secret shown once in session-authenticated settings. Not a browser JWT."}},"schemas":{"PurposeField":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":40,"minLength":1,"description":"Placeholder name without braces."},"label":{"type":"string","maxLength":120,"description":"Label displayed to the person filling in the field."},"hint":{"type":"string","maxLength":120,"description":"Optional hint displayed next to the field."},"filled_by":{"type":"string","enum":["payer","creator"],"default":"payer","description":"payer fills the field on the payment page; creator fills it when using a template. For payment links, use payer."}},"required":["name"]},"PaymentDetails":{"type":"object","additionalProperties":false,"properties":{"payment_type":{"type":"string","enum":["iban","card"],"description":"Payment destination: IBAN account or bank card."},"amount":{"type":"string","pattern":"^(0\\.(0[1-9]|[1-9][0-9]?)|[1-9][0-9]*(\\.[0-9]{1,2})?)$","maxLength":32,"description":"Amount in UAH as a positive decimal string, with at most two decimal places, for example \"123.45\"."},"purpose":{"type":"string","maxLength":1024,"description":"Payment purpose, up to 1024 UTF-8 bytes. Use {name} for a field the payer fills in; up to 10 placeholders. Configure these fields with the sibling purpose_fields property."},"purpose_fields":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/PurposeField"},"description":"Labels and hints for placeholders in purpose. Each name must match a {name} placeholder. This is a separate top-level field, not an object inside purpose."},"payment_category":{"type":"string","enum":["goods","services","personal","donation","other"],"default":"other","description":"IBAN payments only. goods: goods; services: services; personal: personal transfer; donation: donation; other: other payment."},"receiver_name":{"type":"string","maxLength":140,"description":"IBAN recipient’s name."},"receiver_bank":{"type":"string","maxLength":255,"description":"Optional recipient bank name."},"iban":{"type":"string","maxLength":34,"pattern":"^UA[0-9]{27}$","description":"Ukrainian IBAN: UA followed by 27 digits, with a valid checksum."},"edrpou":{"type":"string","maxLength":10,"pattern":"^([0-9]{8}|[0-9]{10})$","description":"Recipient’s 8-digit EDRPOU or 10-digit RNOKPP code."},"card_receiver_name":{"type":"string","maxLength":255,"description":"Card recipient’s name."},"card_number":{"type":"string","maxLength":19,"pattern":"^[0-9]{13,19}$","description":"Bank card number containing 13–19 digits, without spaces or separators."},"due_on":{"type":"string","format":"date-time","pattern":"Z$","description":"Optional payment deadline as a future UTC RFC3339 timestamp; null means no deadline.","nullable":true},"order_number":{"type":"string","maxLength":255,"description":"Optional order or invoice number for your records."}},"required":["payment_type","amount","purpose"],"anyOf":[{"properties":{"payment_type":{"enum":["iban"]}},"required":["receiver_name","iban","edrpou"]},{"properties":{"payment_type":{"enum":["card"]}},"required":["card_receiver_name","card_number"]}],"description":"Payment details for an IBAN account or bank card."},"TemplatePaymentDetails":{"description":"Payment details for an IBAN account or bank card.","anyOf":[{"title":"IBAN payment","type":"object","additionalProperties":false,"properties":{"payment_type":{"type":"string","enum":["iban"],"description":"Payment destination: IBAN account or bank card."},"amount":{"type":"string","pattern":"^$|^(0\\.(0[1-9]|[1-9][0-9]?)|[1-9][0-9]*(\\.[0-9]{1,2})?)$","maxLength":32,"description":"Optional UAH decimal string. Leave empty or omit to set the amount when creating a link."},"purpose":{"type":"string","maxLength":1024,"description":"Payment purpose, up to 1024 UTF-8 bytes. Use {name} for a field the payer fills in; up to 10 placeholders. Configure these fields with the sibling purpose_fields property."},"purpose_fields":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/PurposeField"},"description":"Labels and hints for placeholders in purpose. Each name must match a {name} placeholder. This is a separate top-level field, not an object inside purpose."},"payment_category":{"type":"string","enum":["goods","services","personal","donation","other"],"default":"other","description":"IBAN payments only. goods: goods; services: services; personal: personal transfer; donation: donation; other: other payment."},"receiver_name":{"type":"string","maxLength":140,"description":"IBAN recipient’s name."},"receiver_bank":{"type":"string","maxLength":255,"description":"Optional recipient bank name."},"iban":{"type":"string","maxLength":34,"pattern":"^UA[0-9]{27}$","description":"Ukrainian IBAN: UA followed by 27 digits, with a valid checksum."},"edrpou":{"type":"string","maxLength":10,"pattern":"^([0-9]{8}|[0-9]{10})$","description":"Recipient’s 8-digit EDRPOU or 10-digit RNOKPP code."}},"required":["payment_type","receiver_name","iban","edrpou"]},{"title":"Card payment","type":"object","additionalProperties":false,"properties":{"payment_type":{"type":"string","enum":["card"],"description":"Payment destination: IBAN account or bank card."},"amount":{"type":"string","pattern":"^$|^(0\\.(0[1-9]|[1-9][0-9]?)|[1-9][0-9]*(\\.[0-9]{1,2})?)$","maxLength":32,"description":"Optional UAH decimal string. Leave empty or omit to set the amount when creating a link."},"purpose":{"type":"string","maxLength":1024,"description":"Payment purpose, up to 1024 UTF-8 bytes. Use {name} for a field the payer fills in; up to 10 placeholders. Configure these fields with the sibling purpose_fields property."},"purpose_fields":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/PurposeField"},"description":"Labels and hints for placeholders in purpose. Each name must match a {name} placeholder. This is a separate top-level field, not an object inside purpose."},"card_receiver_name":{"type":"string","maxLength":255,"description":"Card recipient’s name."},"card_number":{"type":"string","maxLength":19,"pattern":"^[0-9]{13,19}$","description":"Bank card number containing 13–19 digits, without spaces or separators."}},"required":["payment_type","card_receiver_name","card_number"]}]},"CreateLinkRequest":{"description":"Payment details for an IBAN account or bank card.","anyOf":[{"title":"IBAN payment","type":"object","additionalProperties":false,"properties":{"payment_type":{"type":"string","enum":["iban"],"description":"Payment destination: IBAN account or bank card."},"amount":{"type":"string","pattern":"^(0\\.(0[1-9]|[1-9][0-9]?)|[1-9][0-9]*(\\.[0-9]{1,2})?)$","maxLength":32,"description":"Amount in UAH as a positive decimal string, with at most two decimal places, for example \"123.45\"."},"purpose":{"type":"string","maxLength":1024,"description":"Payment purpose, up to 1024 UTF-8 bytes. Use {name} for a field the payer fills in; up to 10 placeholders. Configure these fields with the sibling purpose_fields property."},"purpose_fields":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/PurposeField"},"description":"Labels and hints for placeholders in purpose. Each name must match a {name} placeholder. This is a separate top-level field, not an object inside purpose."},"payment_category":{"type":"string","enum":["goods","services","personal","donation","other"],"default":"other","description":"IBAN payments only. goods: goods; services: services; personal: personal transfer; donation: donation; other: other payment."},"receiver_name":{"type":"string","maxLength":140,"description":"IBAN recipient’s name."},"receiver_bank":{"type":"string","maxLength":255,"description":"Optional recipient bank name."},"iban":{"type":"string","maxLength":34,"pattern":"^UA[0-9]{27}$","description":"Ukrainian IBAN: UA followed by 27 digits, with a valid checksum."},"edrpou":{"type":"string","maxLength":10,"pattern":"^([0-9]{8}|[0-9]{10})$","description":"Recipient’s 8-digit EDRPOU or 10-digit RNOKPP code."},"due_on":{"type":"string","format":"date-time","pattern":"Z$","description":"Optional payment deadline as a future UTC RFC3339 timestamp; null means no deadline.","nullable":true},"order_number":{"type":"string","maxLength":255,"description":"Optional order or invoice number for your records."},"template_id":{"type":"string","minLength":1,"maxLength":128,"nullable":true,"description":"Optional ID of one of your templates. Supply payment details separately; they are not copied from the template."}},"required":["payment_type","amount","purpose","receiver_name","iban","edrpou"]},{"title":"Card payment","type":"object","additionalProperties":false,"properties":{"payment_type":{"type":"string","enum":["card"],"description":"Payment destination: IBAN account or bank card."},"amount":{"type":"string","pattern":"^(0\\.(0[1-9]|[1-9][0-9]?)|[1-9][0-9]*(\\.[0-9]{1,2})?)$","maxLength":32,"description":"Amount in UAH as a positive decimal string, with at most two decimal places, for example \"123.45\"."},"purpose":{"type":"string","maxLength":1024,"description":"Payment purpose, up to 1024 UTF-8 bytes. Use {name} for a field the payer fills in; up to 10 placeholders. Configure these fields with the sibling purpose_fields property."},"purpose_fields":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/PurposeField"},"description":"Labels and hints for placeholders in purpose. Each name must match a {name} placeholder. This is a separate top-level field, not an object inside purpose."},"card_receiver_name":{"type":"string","maxLength":255,"description":"Card recipient’s name."},"card_number":{"type":"string","maxLength":19,"pattern":"^[0-9]{13,19}$","description":"Bank card number containing 13–19 digits, without spaces or separators."},"due_on":{"type":"string","format":"date-time","pattern":"Z$","description":"Optional payment deadline as a future UTC RFC3339 timestamp; null means no deadline.","nullable":true},"order_number":{"type":"string","maxLength":255,"description":"Optional order or invoice number for your records."},"template_id":{"type":"string","minLength":1,"maxLength":128,"nullable":true,"description":"Optional ID of one of your templates. Supply payment details separately; they are not copied from the template."}},"required":["payment_type","amount","purpose","card_receiver_name","card_number"]}]},"Link":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1,"maxLength":128},"created_at":{"type":"string","format":"date-time","pattern":"Z$","description":"UTC RFC3339 timestamp."},"url":{"type":"string","format":"uri"},"template_id":{"type":"string","minLength":1,"maxLength":128,"nullable":true},"payment_details":{"$ref":"#/components/schemas/PaymentDetails"},"paid_at":{"type":"string","format":"date-time","pattern":"Z$","description":"UTC RFC3339 timestamp.","nullable":true},"archived_at":{"type":"string","format":"date-time","pattern":"Z$","description":"UTC RFC3339 timestamp.","nullable":true}},"required":["id","created_at","url","template_id","payment_details","paid_at","archived_at"]},"Template":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1,"maxLength":128},"created_at":{"type":"string","format":"date-time","pattern":"Z$","description":"UTC RFC3339 timestamp."},"updated_at":{"type":"string","format":"date-time","pattern":"Z$","description":"UTC RFC3339 timestamp."},"name":{"type":"string","maxLength":100,"minLength":1},"payment_details":{"$ref":"#/components/schemas/TemplatePaymentDetails"},"usage_count":{"type":"integer","minimum":0}},"required":["id","created_at","updated_at","name","payment_details","usage_count"]},"CreateTemplateRequest":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":100,"minLength":1},"payment_details":{"$ref":"#/components/schemas/TemplatePaymentDetails"}},"required":["name","payment_details"]},"UpdateTemplateRequest":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":100,"minLength":1},"payment_details":{"$ref":"#/components/schemas/TemplatePaymentDetails"}},"minProperties":1},"IBANQRRequest":{"type":"object","additionalProperties":false,"properties":{"recipient":{"type":"string","maxLength":140,"minLength":1},"iban":{"type":"string","maxLength":29,"pattern":"^UA[0-9]{27}$"},"recipient_code":{"type":"string","maxLength":10,"pattern":"^([0-9]{8}|[0-9]{10})$"},"category":{"type":"string","enum":["goods","services","personal","donation","other"],"default":"other"},"amount":{"type":"string","pattern":"^(0\\.(0[1-9]|[1-9][0-9]?)|[1-9][0-9]*(\\.[0-9]{1,2})?)$","maxLength":32,"description":"Positive UAH decimal string, maximum 999999999.99, at most two fractional digits; never JSON numeric/float."},"purpose":{"type":"string","maxLength":420,"description":"Fully resolved bank-compatible purpose, up to 420 characters; total NBU payload limit may impose a tighter combined bound. No unresolved placeholders."},"reference":{"type":"string","maxLength":35,"minLength":1,"description":"Your payment reference, 1–35 ASCII characters."},"created_at":{"type":"string","format":"date-time","pattern":"Z$","description":"UTC RFC3339 timestamp."},"due_at":{"type":"string","format":"date-time","pattern":"Z$","description":"UTC RFC3339 timestamp."}},"required":["recipient","iban","recipient_code","amount","purpose","reference"]},"FieldError":{"type":"object","additionalProperties":false,"properties":{"field":{"type":"string","maxLength":255,"minLength":1},"code":{"type":"string","maxLength":64,"minLength":1},"message":{"type":"string","maxLength":512,"minLength":1}},"required":["field","code","message"]},"ErrorDetail":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["invalid_request","unauthorized","forbidden","not_found","conflict","invalid_payment_details","rate_limited","method_not_allowed","payload_too_large","unsupported_media_type","internal_error"]},"message":{"type":"string","maxLength":512,"minLength":1},"fields":{"type":"array","maxItems":32,"items":{"$ref":"#/components/schemas/FieldError"}}},"required":["code","message"]},"Error":{"type":"object","additionalProperties":false,"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"},"request_id":{"type":"string","minLength":1,"maxLength":128}},"required":["error","request_id"]},"PaidEventData":{"type":"object","additionalProperties":false,"properties":{"link_id":{"type":"string","minLength":1,"maxLength":128},"template_id":{"type":"string","minLength":1,"maxLength":128,"nullable":true},"order_number":{"type":"string","maxLength":255},"amount":{"type":"string","pattern":"^(0\\.(0[1-9]|[1-9][0-9]?)|[1-9][0-9]*(\\.[0-9]{1,2})?)$","maxLength":32,"description":"Positive UAH decimal string, at most two fractional digits; zero is invalid. Never JSON numeric/float."},"paid_at":{"type":"string","format":"date-time","pattern":"Z$","description":"UTC RFC3339 timestamp."},"source":{"type":"string","enum":["ui","api"]}},"required":["link_id","template_id","order_number","amount","paid_at","source"]},"PaidEvent":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","minLength":1,"maxLength":128},"type":{"type":"string","enum":["payment_request.marked_paid"]},"schema_version":{"type":"integer","enum":[1]},"occurred_at":{"type":"string","format":"date-time","pattern":"Z$","description":"UTC RFC3339 timestamp."},"request_id":{"type":"string","minLength":1,"maxLength":128},"data":{"$ref":"#/components/schemas/PaidEventData"}},"required":["id","type","schema_version","occurred_at","request_id","data"]},"LinkPage":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/Link"}},"next_cursor":{"type":"string","maxLength":512,"minLength":1,"nullable":true}},"required":["data","next_cursor"]},"TemplatePage":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/Template"}},"next_cursor":{"type":"string","maxLength":512,"minLength":1,"nullable":true}},"required":["data","next_cursor"]}},"parameters":{"Client":{"in":"header","name":"X-Payme-Client","required":false,"description":"Optional integration name and version, for example acme-crm/1.2. Use 1–64 ASCII characters starting with a letter or digit; allowed punctuation: dot, underscore, slash, space and hyphen.","schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9][A-Za-z0-9._/ -]{0,63}$"}},"Id":{"in":"path","name":"id","required":true,"description":"Resource ID returned by the API. A missing or inaccessible resource returns 404.","schema":{"type":"string","minLength":1,"maxLength":128}},"Limit":{"in":"query","name":"limit","description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},"Cursor":{"in":"query","name":"cursor","description":"Pass next_cursor from the previous page unchanged, with the same filters. An invalid cursor returns 400.","schema":{"type":"string","maxLength":512,"minLength":1}},"Paid":{"in":"query","name":"paid","description":"Omitted includes paid/unpaid; true selects paid, false unpaid.","schema":{"type":"boolean"}},"Archived":{"in":"query","name":"archived","description":"Omitted/false excludes archived; true selects archived; all includes both.","schema":{"type":"string","enum":["false","true","all"],"default":"false"}},"Idempotency":{"in":"header","name":"Idempotency-Key","description":"Optional unique key for retrying creation requests within 24 hours. Use 1–128 ASCII letters, digits, dots, underscores, colons or hyphens. Repeat the same request with the same key; different details return 409.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"}},"Format":{"in":"query","name":"format","description":"Image format: PNG or JPEG.","schema":{"type":"string","enum":["png","jpeg"],"default":"png"}},"Size":{"in":"query","name":"size","description":"Width and height of the square image in pixels.","schema":{"type":"integer","minimum":128,"maximum":1024,"default":512}}},"headers":{"X-Request-ID":{"description":"Server request correlation ID, also returned in JSON errors. Replay returns original body; this header identifies the current HTTP attempt.","schema":{"type":"string","minLength":1,"maxLength":128}},"X-Payme-QR-Mode":{"description":"Bank payload or payment-page fallback; standalone always iban.","schema":{"type":"string","enum":["iban","payment_page","legacy_iban"]}}},"responses":{"400":{"description":"Malformed JSON, unsupported property, parameter, cursor or calling-system header.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_request","message":"Malformed JSON, unsupported property, parameter, cursor or calling-system header."},"request_id":"req_example"}}}},"401":{"description":"Missing, malformed, expired, revoked or unknown Bearer credential.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"},"WWW-Authenticate":{"schema":{"type":"string"},"description":"Bearer challenge."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"Missing, malformed, expired, revoked or unknown Bearer credential."},"request_id":"req_example"}}}},"403":{"description":"The token does not allow this operation.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"forbidden","message":"The token does not allow this operation."},"request_id":"req_example"}}}},"404":{"description":"Resource not found.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"Resource not found."},"request_id":"req_example"}}}},"405":{"description":"Unsupported method. Link PATCH/PUT are never supported.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"},"Allow":{"description":"Supported methods for this route.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"method_not_allowed","message":"Unsupported method. Link PATCH/PUT are never supported."},"request_id":"req_example"}}}},"409":{"description":"The request conflicts with the current resource state or a previous request using this idempotency key.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"conflict","message":"The request conflicts with the current resource state or a previous request using this idempotency key."},"request_id":"req_example"}}}},"413":{"description":"Request exceeds 65536 UTF-8 bytes.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"payload_too_large","message":"Request exceeds 65536 UTF-8 bytes."},"request_id":"req_example"}}}},"415":{"description":"JSON request requires application/json.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unsupported_media_type","message":"JSON request requires application/json."},"request_id":"req_example"}}}},"422":{"description":"Payment details or bank-compatible standalone QR are invalid.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_payment_details","message":"Payment details or bank-compatible standalone QR are invalid."},"request_id":"req_example"}}}},"429":{"description":"Too many requests. Wait before retrying.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests. Wait before retrying."},"request_id":"req_example"}}}},"500":{"description":"The request could not be completed. Try again later.","headers":{"X-Request-ID":{"$ref":"#/components/headers/X-Request-ID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"internal_error","message":"The request could not be completed. Try again later."},"request_id":"req_example"}}}}}},"x-payme-webhooks":{"payment_request.marked_paid":{"description":"Notifies you when a payment link is marked paid. This is a reported status, not bank confirmation. Verify the signature and timestamp before processing; see the Webhooks guide above.","method":"POST","contentType":"application/json","schema":{"$ref":"#/components/schemas/PaidEvent"},"headers":{"X-Payme-Timestamp":{"type":"string","pattern":"^[0-9]+$"},"X-Payme-Signature":{"type":"string","pattern":"^v1=[0-9a-f]{64}$"},"X-Payme-Event-ID":{"type":"string","minLength":1,"maxLength":128},"X-Payme-Key-Version":{"type":"string","minLength":1,"maxLength":128}},"testVector":{"secretBase64url":"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8","timestamp":"1791892800","body":"{\"id\":\"event_test\",\"type\":\"payment_request.marked_paid\",\"schema_version\":1,\"occurred_at\":\"2026-10-13T12:00:00Z\",\"request_id\":\"req_test\",\"data\":{\"link_id\":\"link_test\",\"template_id\":null,\"order_number\":\"INV-1\",\"amount\":\"123.45\",\"paid_at\":\"2026-10-13T12:00:00Z\",\"source\":\"api\"}}","signature":"v1=7694efa202628c73c035fa58de589f0e1721b87345c5d0d1a96b704247e02dfc"}}}}