Skip to main content

POST /user/btp

Generate a BTP token for a user

A bilateral transfer protocol (BTP) token allows an Interledger Protocol (ILP) stream to be opened on behalf of the Coil user.

A BTP token will not be issued if the user it's being requested for doesn't have an active Coil Membership. In this scenario, the endpoint will throw a 403.


Request headers

No encoded information is required in the body.

Authorization BearerBearer access_token, where access_token is the JWT-format access token granted to your app through /oauth/token.

Example request

curl -X POST  \
'' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Authorization: Bearer eyJhbGciOi...JSUzI1NfsQ' \
-d ''

Response parameters

The response is a JSON object containing the BTP token.

btpTokenstringsimple_wmA short-lived token (about 30 minutes) for authenticating to Coil's connector so that Coil can make payments to a site as the user is on the site. If you expect users to be on a monetized site for more than 30 minutes, you should set a timeout and fetch a new BTP token from your backend.

Example response

"btpToken": "eyJhbGciOiJCchQ8...SeOz98I2Sqyf1LrVM"