Paysafe.Applications (Paysafe v1.0.0)

Copy Markdown View Source

Applications (Merchant Onboarding) API for platform partners.

Enables platform partners to programmatically onboard sub-merchants. Available for Canada and United States.

Base path: /merchant/v1/applications.

Workflow

  1. create/3POST /merchant/v1/applications. Creates a draft application. From this point the application can still be edited.
  2. update/4 (optional) — PUT /merchant/v1/applications/{appId}. Update any field before submission.
  3. upload_document/4 (optional) — attach supporting documents.
  4. get_terms_and_conditions/3GET /merchant/v1/applications/{appId}/termsandconditions. Retrieve the terms the merchant must accept.
  5. submit/3PATCH /merchant/v1/applications/{appId}. Sends the application to Paysafe for review. The application can no longer be modified via the API after this call.

Subscribe to webhooks for application status updates rather than polling.

Example

{:ok, app} = Paysafe.Applications.create(config, %{
  merchant_descriptor: "ACME Corp",
  currency_code: "USD",
  contact: %{first_name: "Jane", last_name: "Doe", email: "jane@acme.com"}
})

{:ok, terms} = Paysafe.Applications.get_terms_and_conditions(config, app.id)

{:ok, submitted} = Paysafe.Applications.submit(config, app.id)

Summary

Functions

Create a draft merchant application.

Retrieve an application by ID.

Retrieve the terms and conditions the merchant must accept before processing can begin.

Submit the application to Paysafe for review.

Update a draft application. Only possible before submit/3 is called.

Upload a supporting document for an application.

Functions

create(config, params, opts \\ [])

@spec create(Paysafe.Config.t(), map(), keyword()) ::
  {:ok, Paysafe.Types.Application.t()} | {:error, Paysafe.Error.t()}

Create a draft merchant application.

See the Paysafe Applications API reference for the full parameter list, which varies by country and business type.

get(config, application_id, opts \\ [])

@spec get(Paysafe.Config.t(), String.t(), keyword()) ::
  {:ok, Paysafe.Types.Application.t()} | {:error, Paysafe.Error.t()}

Retrieve an application by ID.

get_terms_and_conditions(config, application_id, opts \\ [])

@spec get_terms_and_conditions(Paysafe.Config.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, Paysafe.Error.t()}

Retrieve the terms and conditions the merchant must accept before processing can begin.

submit(config, application_id, opts \\ [])

@spec submit(Paysafe.Config.t(), String.t(), keyword()) ::
  {:ok, Paysafe.Types.Application.t()} | {:error, Paysafe.Error.t()}

Submit the application to Paysafe for review.

After this call succeeds, the application can no longer be modified via the API.

update(config, application_id, params, opts \\ [])

@spec update(Paysafe.Config.t(), String.t(), map(), keyword()) ::
  {:ok, Paysafe.Types.Application.t()} | {:error, Paysafe.Error.t()}

Update a draft application. Only possible before submit/3 is called.

upload_document(config, application_id, params, opts \\ [])

@spec upload_document(Paysafe.Config.t(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Paysafe.Error.t()}

Upload a supporting document for an application.

Parameters

  • :document_type — e.g. "BANK_STATEMENT", "GOVERNMENT_ID".
  • :file_content — Base64-encoded file content.
  • :file_name — Original file name.

Documents can be uploaded before or after submission (e.g. when requested by a credit underwriter during review).