๐ŸšชWithdrawals

Withdrawals are used to retire the funds from your TurinPay balance to your external bitcoin wallet.

Execute withdrawal

POST https://api.turinpay.com/withdrawals

Execute a withdrawal action to refund your balance from TurinPay

Headers

NameTypeDescription

X-API-Key

string

Authentication token from the API key with the withdrawals role

Request Body

NameTypeDescription

address

string

Bolt11 lightning network invoice address if the type BTC is set to "ln" or an on-chain bitcoin address if tge type is set to "BTC"

type

string

Withdrawal type must be either "ln" (lightning network) or "BTC" (on-chain) by default is set to "ln"

description

string

Withdrawal description

{
    "invoiceId": "92028feb2c4cc7e9c7b1d9ed0fcf903b1daa8dc955bdb377f2be8520d522d93d",
    "amount": 36,
    "buttonId": "ba8ccce1-e3d4-404c-b003-c72f91fc3b1c",
    "buyerEmail": "demo@email.com",
    "checkoutId": "69fe9f2a-d6ed-4369-b059-65d952c83f79",
    "fees": 1,
    "ln": {
        "expiresOn": 1611887410096,
        "chain_address": null,
        "created_at": "2021-01-29T01:30:10.000Z",
        "description": null,
        "id": "92028feb2c4cc7e9c7b1d9ed0fcf903b1daa8dc955bdb377f2be8520d522d93d",
        "mtokens": "36000",
        "request": "lntb360n1pspxefzpp5jgpgl6evfnr7n3a3m8kslnus8vw64rwf2k7mxaljh6zjp4fzmy7sdqqcqzpgxqrrsssp5mmmdvdq7raf3fhadv8mj6v770z7x7yufy963sss37rxhzg28md7q9qy9qsq5fr7rsc8x0gghdnzk8jnxm5mpuh889vx577xqju29rvqy0wja9ykcvdsx8zhzujgcmj958zqagnf5yh3dmcg8tmgyyuehfq3fxu4tssqge57j5",
        "secret": "fe97d60bf8c48a31c60e8092946c5cb43e522202e52ee1fa493c89389ed6c8b0",
        "tokens": 36,
        "requestBtn": "lightning:lntb360n1pspxefzpp5jgpgl6evfnr7n3a3m8kslnus8vw64rwf2k7mxaljh6zjp4fzmy7sdqqcqzpgxqrrsssp5mmmdvdq7raf3fhadv8mj6v770z7x7yufy963sss37rxhzg28md7q9qy9qsq5fr7rsc8x0gghdnzk8jnxm5mpuh889vx577xqju29rvqy0wja9ykcvdsx8zhzujgcmj958zqagnf5yh3dmcg8tmgyyuehfq3fxu4tssqge57j5"
    },
    "orderId": "Order-1",
    "rates": {
        "EUR": 28003.4,
        "USD": 33949.8
    },
    "status": "PAID",
    "userId": "0224a944-b051-4d79-8c41-88dee575aafe",
    "ipn": {
        "ack_on": 1611883827300
    },
    "network": "testnet"
}

Retrieve a withdrawal

GET https://api.turinpay.com/withdrawals/

This endpoint allows you to retrieve a specific withdrawal by its id

Query Parameters

NameTypeDescription

id

string

Withdrawal id

{
    "invoiceId": "92028feb2c4cc7e9c7b1d9ed0fcf903b1daa8dc955bdb377f2be8520d522d93d",
    "amount": 36,
    "buttonId": "ba8ccce1-e3d4-404c-b003-c72f91fc3b1c",
    "buyerEmail": "demo@email.com",
    "checkoutId": "69fe9f2a-d6ed-4369-b059-65d952c83f79",
    "fees": 1,
    "ln": {
        "expiresOn": 1611887410096,
        "chain_address": null,
        "created_at": "2021-01-29T01:30:10.000Z",
        "description": null,
        "id": "92028feb2c4cc7e9c7b1d9ed0fcf903b1daa8dc955bdb377f2be8520d522d93d",
        "mtokens": "36000",
        "request": "lntb360n1pspxefzpp5jgpgl6evfnr7n3a3m8kslnus8vw64rwf2k7mxaljh6zjp4fzmy7sdqqcqzpgxqrrsssp5mmmdvdq7raf3fhadv8mj6v770z7x7yufy963sss37rxhzg28md7q9qy9qsq5fr7rsc8x0gghdnzk8jnxm5mpuh889vx577xqju29rvqy0wja9ykcvdsx8zhzujgcmj958zqagnf5yh3dmcg8tmgyyuehfq3fxu4tssqge57j5",
        "secret": "fe97d60bf8c48a31c60e8092946c5cb43e522202e52ee1fa493c89389ed6c8b0",
        "tokens": 36,
        "requestBtn": "lightning:lntb360n1pspxefzpp5jgpgl6evfnr7n3a3m8kslnus8vw64rwf2k7mxaljh6zjp4fzmy7sdqqcqzpgxqrrsssp5mmmdvdq7raf3fhadv8mj6v770z7x7yufy963sss37rxhzg28md7q9qy9qsq5fr7rsc8x0gghdnzk8jnxm5mpuh889vx577xqju29rvqy0wja9ykcvdsx8zhzujgcmj958zqagnf5yh3dmcg8tmgyyuehfq3fxu4tssqge57j5"
    },
    "orderId": "Order-1",
    "rates": {
        "EUR": 28003.4,
        "USD": 33949.8
    },
    "status": "PAID",
    "userId": "0224a944-b051-4d79-8c41-88dee575aafe",
    "ipn": {
        "ack_on": 1611883827300
    },
    "network": "testnet"
}

Last updated