Step 1: Onboarding flow

Any seller who wants to sell with credit card is required to KYC with Paper. To start, embed the following page as an iframe in your application: https://withpaper.com/sdk/2022-08-12/seller-onboarding/verify-email?platformId=YOUR_PLATFORM_ID

<iframe src="https://withpaper.com/sdk/2022-08-12/seller-onboarding/verify-email?platformId=YOUR_PLATFORM_ID"></iframe>

Upon successful login and KYC, this page calls postMessage to the parent window. If the user already KYCโ€™d, this should only be a login flow which will generate a renewed auth token:

window.opener.postMessage({ // or window.parent if in iframe
    eventType: 'sellerOnboardingEmailVerified',
    authToken: 'eyJhbGciOiJIUzI1N...' // JWT
})

Be sure to handle this message in your page that opens or embeds the link

โ˜๏ธ The authToken JWT has a 30 day expiration. You should exchange this authToken for a developer key. The developer key is then used to make any necessary API calls (backend only) on behalf of the userโ€™s Paper account.

Step 2: Exchanging authToken for a developerKey

You can only exchange authTokens for users that went through the KYC flow from the link that contained your public key.

POST https://withpaper.com/api/2022-08-12/platform/get-developer-key

Authorization: Bearer <Partner's developer secret key>

[Body]
{
  authToken: 'eyJhbGciOiJIUzI1N...' // (from above)
}

[Response]
200 OK
{
    "developerKey": '...'
}

Step 3: Use Paperโ€™s regular API functions using the developerKey

For example, if you would like to enable credit card NFT checkouts for your customers:

  1. Youโ€™ll need to register a contract. (API Docs: https://docs.withpaper.com/reference/register-contract)
  2. Once a contract is created, you can either generate a checkout link (https://docs.withpaper.com/docs/shareable-checkout-links), a one-time checkout link (https://docs.withpaper.com/docs/dynamic-one-time-checkout-links), or use our embedded checkout SDK (https://docs.withpaper.com/docs/checkout-elements).

If you would like to enable embedded wallets for your customers, follow the integration guide for embedded wallets.