POST /user/btp

Generate a bilateral transfer protocol (BTP) token for a Coil user

POST https://api.coil.com/user/btp

A BTP token allows an Interledger Protocol (ILP) stream to be opened on behalf of the Coil user. Generate a token for all users, even if they aren't a paying Coil Member. The presence of a BTP token is not an indication that a payment will be attempted.

Query headers

Key

Value

Content-Type

application/x-www-form-urlencoded

Authorization Bearer

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

No encoded information is required in the body.

Example request

curl -X POST \
'https://api.coil.com/user/btp' \
-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.

Parameter

Type

Description

btpToken

string

A short-lived token (about 30 minutes) for authenticating to Coil's connector so that Coil can make payments to a site on behalf of the user.

‚Äč

If you expect users to be on a monetized site for longer than 30 minutes, you should set a timeout and fetch a new BTP token from your backend.

Example response

{
"btpToken": "eyJhbGciOiJCchQ8...SeOz98I2Sqyf1LrVM"
}