# How to integrate BNPL / Purchase Order Financing (POF) for Market

# Overview of the flow

flow

  1. User selects payment with BNPL / POF at the checkout page on Market platform and gets redirected to serviceX to complete the application.
  2. All the application data and some bits of information that Market has is collected by serviceX and sent to Credify for credit assessment.
  3. Credify sends the result of the credit assessment to a corresponding lending facility.
  4. The lending facility request User to e-sign the contract.
  5. The signed contract is sent to the lending facility to set up a loan account.
  6. The lending facility requests User to make a down payment.
  7. User needs to make a down payment to the lending facility.
  8. Once the lending facility receives the down payment, User gets redirected to Market platform to complete the purchase.
  9. Market requests serviceX for disbursement.
  10. serviceX instructs the lending facility to disburse the loan amount to Market.
  11. The lending facility notifies User of repayment schedule.
  12. User repays the loan amount to the lending facility.
  13. The lending facility notifies serviceX of the repayment.
  14. serviceX notifies Market of the repayment information.

# Integration steps for Market

  1. Market needs to integrate Create a payment intent API
  2. Next, Market needs to implement a redirect endpoint to render checkout completion page for User.
  3. In addition, it is recommended to implement a webhook endpoint to receive notifications from serviceX about the status of the transaction.

# 1. Integrate Create a payment intent API

All API requests must be authenticated with an access token. The access token is obtained by calling the following API.

🔗 Authentication API document

You can reuse the same token until it expires. The token expires in 24 hours.

# Request

POST https://sandbox-api.credify.dev/v2/public/client-auth

The key is an API key you can generate on serviceX dashboard.

{
  "key": "xxxxxxxxxxxxxxxxx"
}

# Response

{
  "access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

The following API is used to create a payment intent for a BNPL / POF transaction. The payment intent is used to track the status of the transaction and handle the customer interaction.

🔗 Intent API document

# Request

POST https://sandbox-api.credify.dev/v2/integration/marketplace/intents

You need to pass the access token obtained from the previous step in the Authorization header as a bearer token.

# Response

This API returns a URL that you can redirect the User to proceed with BNPL / POF.

{
  "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "app_url": "https://sandbox-app.credify.one/dop/intents/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

The integration flow is Market frontend app shows a button at the checkout page. When the user clicks the button, Market backend app calls this API to create a payment intent. Then, Market frontend app calls Market backend API to call Credify Intent API. Finally, Market frontend app redirects the user to the URL returned from this API.

# 2. Handle redirection from serviceX after the user completes the application

After the user completes the application, serviceX redirects the user to the URL you create. The URL contains a path parameter intentId that you can use to retrieve the payment intent.

You can set Api base Url on serviceX dashboard. The redirection is made with the following URL.

${Api base Url}/bnpl/orders/${intentId}/redirect

It may contain a query parameter error if there is an error during the application process. You can use the error parameter to display an error message to the user.

# 3. Handle webhook notifications from serviceX

serviceX sends webhook notifications to the URL you set on serviceX dashboard.

Please reference this page for more details. Webhook API document

Last Updated: 5/17/2023, 9:21:23 AM