{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-simpay-flow/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Płatności w imieniu submerchanta","description":"Znajdziesz tutaj wszystkie niezbędne informacje dotyczące integracji i obsługi systemu płatności SimPay.pl","siteUrl":"https://docs.simpay.pl","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"płatności-w-imieniu-submerchanta","__idx":0},"children":["Płatności w imieniu submerchanta"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Transakcje dla submerchantów tworzysz przez standardowe ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/payment"},"children":["API Płatności Online"]}," - te same endpointy, co przy zwykłej integracji. Różnią się tylko dwa elementy:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["w ścieżce podajesz ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serviceId"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["usługi nadrzędnej"]}," (usługi Płatności Online powiązanej z Twoją usługą Flow),"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["w nagłówku ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-sim-flow-submerchant"]}," wskazujesz submerchanta, w imieniu którego wykonujesz żądanie."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serviceId"]}," usługi nadrzędnej znajdziesz w polu ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentService.id"]}," w odpowiedzi ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/flow/flowgetservice"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /flow/{flowServiceId}"]}]},"."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"przykład-tworzenie-transakcji","__idx":1},"children":["Przykład: tworzenie transakcji"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.simpay.pl/payment/{serviceIdUslugiNadrzednej}/transactions\" \\\n  -H \"Authorization: Bearer TWÓJ_TOKEN_API\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Accept: application/json\" \\\n  -H \"x-sim-flow-submerchant: user-123\" \\\n  -d '{\n    \"amount\": 49.99,\n    \"description\": \"Zamówienie #1001\",\n    \"control\": \"order-1001\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Transakcja zostanie utworzona w usłudze submerchanta ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user-123"]},", a środki trafią na jego portfel (lub - dla instytucji płatniczych - zostaną rozliczone z IP)."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"nagłówek-x-sim-flow-submerchant","__idx":2},"children":["Nagłówek ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-sim-flow-submerchant"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Wartość"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID submerchanta (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["flsm_..."]},") lub jego ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["customId"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Kiedy wymagany"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["W każdym żądaniu ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/payment/{serviceId}/..."]},", gdy ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serviceId"]}," to usługa nadrzędna Twojej aktywnej usługi Flow"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Kiedy ignorowany"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Gdy ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serviceId"]}," to zwykła usługa Płatności Online, niepowiązana z Flow"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Nagłówek działa dla wszystkich endpointów Płatności Online - transakcji, zwrotów, kanałów, walut, subskrypcji, BLIK Level 0 i aliasów BLIK. Każde z tych żądań jest wykonywane w kontekście usługi wskazanego submerchanta. Przykładowo ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /payment/{serviceId}/transactions"]}," zwróci tylko transakcje danego submerchanta."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Nie używaj usługi submerchanta bezpośrednio"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Każdy submerchant ma własną usługę Płatności Online, ale nie można jej używać bezpośrednio. Podanie jej ID jako ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serviceId"]}," zwróci błąd ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422"]},". Zawsze używaj usługi nadrzędnej i nagłówka ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-sim-flow-submerchant"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"możliwe-błędy","__idx":3},"children":["Możliwe błędy"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Kod HTTP"},"children":["Kod HTTP"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"errorCode"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorCode"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Przyczyna"},"children":["Przyczyna"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SIMPAY_FLOW_VALIDATION_ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Brak nagłówka dla usługi nadrzędnej Flow lub nieprawidłowa wartość."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FLOW_SUBMERCHANT_NOT_FOUND"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Submerchant nie istnieje w ramach Twojej usługi Flow."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FLOW_SUBMERCHANT_NOT_ACTIVE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Submerchant nie zakończył onboardingu lub nie jest aktywny."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FLOW_SUBMERCHANT_PAYMENT_SERVICE_NOT_FOUND"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FLOW_SUBMERCHANT_PAYMENT_SERVICE_NOT_ACTIVE"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Usługa Płatności Online submerchanta nie istnieje lub nie jest aktywna."]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"powiadomienia-o-płatnościach","__idx":4},"children":["Powiadomienia o płatnościach"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Powiadomienia IPN o transakcjach submerchantów działają tak samo jak przy zwykłej integracji - zobacz ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/notifications/payment"},"children":["Powiadomienia o płatnościach"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Domyślnie powiadomienia dla wszystkich submerchantów trafiają na adres IPN usługi nadrzędnej i są podpisywane jej kluczem. Dla wybranego submerchanta możesz ustawić osobny adres."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["W powiadomieniach płatności dla submerchantów:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["service_id"]}," zawiera ID usługi nadrzędnej,"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["nowy obiekt ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.flow"]}," wskazuje submerchanta (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["submerchant_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["submerchant_custom_id"]},") i usługę Flow - we wszystkich zdarzeniach poza ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ipn:test"]},","]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["w ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction:status_changed"]}," nowe pole ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount.commission_flow"]}," zawiera Twoją prowizję Flow."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Szczegóły i przykład: ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/simpay-flow/webhooks#webhooki-p%C5%82atno%C5%9Bci-ipn-w-simpay-flow"},"children":["Webhooki płatności w SimPay Flow"]},"."]}]},"headings":[{"value":"Płatności w imieniu submerchanta","id":"płatności-w-imieniu-submerchanta","depth":1},{"value":"Przykład: tworzenie transakcji","id":"przykład-tworzenie-transakcji","depth":2},{"value":"Nagłówek x-sim-flow-submerchant","id":"nagłówek-x-sim-flow-submerchant","depth":2},{"value":"Możliwe błędy","id":"możliwe-błędy","depth":3},{"value":"Powiadomienia o płatnościach","id":"powiadomienia-o-płatnościach","depth":2}],"frontmatter":{"seo":{"title":"Płatności w imieniu submerchanta"}},"lastModified":"2026-10-01T15:18:54.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/simpay-flow/payments","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}