NAV Navigation
CURL Node.JS PHP Go

ForgingBlock API

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

The Forgingblock API provides a unified, user friendly and secure layer for developers to build their applications with support for different cryptocurrencies.

Baseurl:

API POST requests are made using Content-Type: "application/x-www-form-urlencoded"

Dashboard:

Create Demo Invoice:

Shows invoice example, non refundable

Access Tokens

Use Dashboard to register new account and to create a new store.

Most operations are perfomed using trade and token access tokens. Those access tokens are private and shouldn't be shared with anyone, including Forgingblock Support.

Access Tokens

Email and password are recommended to use for only Dashboard access.

Cryptocurrency support

Could accept multiple payments simultaneously.

Scalable, generates client-side mnemonic on the setup that merchant need to keep safe, as it couldn't be restored.

Invoice Management

Every new invoice lifetime is 15 minutes (avoiding volatility fluctuations) Invoice lifetime could be changed manually

Invoice status:

Lightning invoices (payment requests) could override expired status

Secondary status:

Available only after invoice is expired or received payment

Invoicing

curl 'https://api.forgingblock.io/v2/create-invoice' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166&amount=1550&currency=usd'

curl 'https://api.forgingblock.io/v2/check-invoice' -H 'Content-Type: application/x-www-form-urlencoded' --data 'invoice=W1a7qBnyXGaSGhqEbWziMp'

curl 'https://api.forgingblock.io/v2/check-invoice-status' -H 'Content-Type: application/x-www-form-urlencoded' --data 'invoice=W1a7qBnyXGaSGhqEbWziMp'

Response examples:

{
    "id": "XzZd7DdJAosdtR3Qvf3jnr",
    "currency": "USD",
    "realAmount": "0.08627969",
    "btcPrice": "0.08627969",
    "status": "new",
    "url": "https://api.forgingblock.io/invoice?id=XzZd7DdJAosdtR3Qvf3jnr"
}
{
    "uiSettings": {
        "extensionPartial": "Bitcoin_Lightning_LikeMethodCheckout",
        "checkoutBodyVueComponentName": "BitcoinLightningLikeMethodCheckout",
        "checkoutHeaderVueComponentName": "BitcoinLightningLikeMethodCheckoutHeader",
        "noScriptPartialName": "Bitcoin_Lightning_LikeMethodCheckoutNoScript"
    },
    "htmlTitle": "ForgingBlock Invoice",
    "defaultLang": "en",
    "isModal": "false",
    "isLightning": "false",
    "cryptoCode": "BTC",
    "invoiceId": "W1a7qBnyXGaSGhqEbWziMp",
    "btcAddress": "1EsPmXNT6ZCr1VUXqdpM9aK1dFJCgNp3Xo",
    "btcDue": "0.00060601",
    "customerEmail": null,
    "businessName": "Wptest",
    "businessUrl": "https://test.com",
    "businessContact": "test@fastmail.mx",
    "invoiceTotalExpirationTime": 30,
    "invoiceCreatedDate": "2022-12-28T11:58:01.000Z",
    "invoiceExpirationDate": "2022-12-28T12:28:01.000Z",
    "checkoutId": "ac1383dc5a8c79156f5e2a72ac889550",
    "checkoutCurrency": "USD",
    "checkoutAmount": "10",
    "checkoutDescription": "Just test",
    "checkoutEmail": "TEST@FMGUY.COM",
    "checkoutCount": 0,
    "checkoutName": "test",
    "requiresRefundEmail": "true",
    "status": "expired",
    "merchantRefLink": "/",
    "maxTimeSeconds": 1800,
    "storeName": "newName2",
    "timeLeft": "00:00",
    "rate": "16501.3 USD",
    "orderAmount": 0.00060601,
    "orderAmountFiat": "10 USD",
    "btcPaid": "0.00000000",
    "orderId": null,
    "isMultiCurrency": false,
    "maxTimeMinutes": 30,
    "paymentType": null,
    "paymentMethodId": "BTC",
    "paymentMethodName": "Bitcoin",
    "cryptoImage": "/imlegacy/bitcoin.svg",
    "storeId": "EyhGReaGRxywkq9iUnRTxG1unAZbqnUA7CFdyfvEGs8q",
    "peerInfo": null,
    "rootPath": "/",
    "redirectAutomatically": false
}

POST /v2/create-invoice

Create new invoice

POST /v2/check-invoice

Get invoice details

POST /v2/check-invoice-status

Get invoice status

Same as /v2/check-invoice, exist for backward compatibility

status contains invoice status

Parameters

For /v2/create-invoice

Parameter In Type Required Description
trade body [string] true trade agreement id
token body [string] true token
amount body [string] true amount for the price
currency body [string] true currency code in ISO 4217
link body [string] false url to follow after the payment
notification body [string] false url for IPN request (used by e-commerce software)
order body [string] false uniq order id (equal to the order id in e-commerce software)

For /v2/check-invoice and /v2/check-invoice-status

Parameter In Type Required Description
invoice body [string] true invoice id

IPN Response Example & Explanation

IPN is sent in case notification parameter is provided. Main IPN purpose is to send notifications to e-commerce software.

You could check guide section Integrate ForgingBlock Payment Gateway to your own applications and backend to get example how to handle IPN.

Also, take a look on IPN Code Sample Repo

{
    "id": "QqZDsqZZNAKqNau23yX9n1",
    "url": "https://api.forgingblock.io/i/QqZDsqZZNAKqNau23yX9n1/BTC",
    "posData": null,
    "status": "paid",
    "btcPrice": "0.00000213",
    "btcPaid": "0.00000213",
    "btcDue": "0"
}

Invoice History

In Dashboard you could find Invoice History in Payments

curl 'https://api.forgingblock.io/v2/invoices-range' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&start=2024-01-01&end=2025-01-08&limit=15&offset=0&full=yes'

curl 'https://api.forgingblock.io/get-store-all-invoices'  -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T'

Response examples:

[
    {
        "InvoiceCurrency": "USD",
        "InvoicePrice": 0.1,
        "CustomerEmail": "test@fastmail.mx",
        "OrderId": null,
        "InvoiceId": "CQhV4YH4qY82ZrP8tnLQv6",
        "InvoiceCreatedDate": "2024-01-19T14:25:18.000Z",
        "InvoiceStatus": "confirmed",
        "CryptoCode": "BTC",
        "Paid": "0.00100000",
        "CryptoToken": null,
        "InvoiceUrl": "https://api-demo.forgingblock.io/i/CQhV4YH4qY82ZrP8tnLQv6/BTC",
        "Tx": "https://blockstream.info/testnet/address/n1fCYt96dy4VpQHhU1wuEZj823RekmD5ne",
        "TxDetails": "https://api.blockcypher.com/v1/btc/test3/addrs/n1fCYt96dy4VpQHhU1wuEZj823RekmD5ne?after=2574285&before=2574287",
        "PaidCrypto": "0.00100000 BTC",
        "ProductName": "1",
        "ExtendedStatus": "overpayment",
        "FeeCrypto": "0.00000500",
        "FeeFiat": "0.212930"
    },
    {
        "InvoiceCurrency": "USD",
        "InvoicePrice": 0.1,
        "CustomerEmail": "test@fastmail.mx",
        "OrderId": null,
        "InvoiceId": "USccwhH66Kyf5J8LX6shex",
        "InvoiceCreatedDate": "2024-01-19T15:04:52.000Z",
        "InvoiceStatus": "confirmed",
        "CryptoCode": "ETH",
        "Paid": "0.01000000",
        "CryptoToken": null,
        "InvoiceUrl": "https://api-demo.forgingblock.io/i/USccwhH66Kyf5J8LX6shex/ETH",
        "Tx": "https://goerli.etherscan.io/tx/0xabdc65d175dd25995244903c19ae0c65c99c71eb901e23947457102852219764",
        "TxDetails": "https://api-goerli.etherscan.io/api?module=account&action=txlist&address=0xa21746298f5F9c5A5463e85C19A2d11c491f646b&startblock=10400121&page=1&endblock=10400124&sort=desc&apikey=YourApiKeyToken",
        "PaidCrypto": "0.01000000 ETH",
        "ProductName": "1",
        "ExtendedStatus": "overpayment",
        "FeeCrypto": "0.00003150",
        "FeeFiat": "0.079560"
    }
]

{
    "invoices": [
        [
            "9M9ms2gvH5smNfy1FpH1y9"
        ],
        [
            "jYEFepK1bEKm48bD3nCKw"
        ],
        ...
    ]
}

POST /v2/invoices-range

Get history with all confirmed invoices for a store

Provide full=yes to /v2/invoices-range in order to receive invoices in all statuses

POST /get-store-all-invoices

Get all previously created invoices IDs as array

Parameters

For /v2/invoices

Parameter In Type Required Description
trade body [string] true trade agreement id
full body [string] false provide all invoice statuses in response
start body [string] true start date
end body [string] true end date
limit body [string] true limit number of invoices (up to 1000)
offset body [string] true offset certain number of invoices

For /get-store-all-invoices

Parameter In Type Required Description
trade body [string] true trade agreement id

Checkout

You could find in Accept payments -> Sell a Product in Dashboard

Checkout

curl 'https://api.forgingblock.io/create-item-sale' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166&amount=550&currency=usd&description=spoon&email=test%40fastmail.mx&count=2&name=bestspoon'

curl 'https://api.forgingblock.io/check-item' -H 'Content-Type: application/x-www-form-urlencoded' --data 'item=327dc71fa54d07bc28f2e81c2c79fdad'

curl 'https://api.forgingblock.io/check-item-status' -H 'Content-Type: application/x-www-form-urlencoded' --data 'item=327dc71fa54d07bc28f2e81c2c79fdad'

curl 'https://api.forgingblock.io/items-list' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166'

curl 'https://api.forgingblock.io/v2/checkout-update' -H 'Content-Type: application/x-www-form-urlencoded' --data 'item=327dc71fa54d07bc28f2e81c2c79fdad&description=thebesttool&name=product1&trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166&count=12'

Response examples:

{
    "item": "5a29847ff8acfcb094257f9a926174a7",
    "amount": "550",
    "currency": "USD",
    "description": "Item description",
    "url": "https://api.forgingblock.io/item/5a29847ff8acfcb094257f9a926174a7",
    "name": "device"
}
{
    "item": "327dc71fa54d07bc28f2e81c2c79fdad",
    "amount": "0.1",
    "currency": "USD",
    "description": "Item description 2",
    "status": false,
    "invoices": [
        "KxATgNW325Zdbequy6QXbZ",
        "V3EMdbp311a79qfc1d4W7P",
        ...
    ],
    "count": 11,
    "name": "device2",
    "multiple": false,
    "items": null
}
{"status":false}
{
    "items": [
        {
            "item": "53e201abc05a1d00935e4768c20471a9",
            "email": "test@fastmail.mx",
            "currency": "USD",
            "amount": "0.1",
            "description": "Item description",
            "invoices": null,
            "count": 2,
            "name": "device",
            "items": null
        },
        {
            "item": "c824524b1a5fccb4c255dcda2a009d92",
            "email": "test@fastmail.mx",
            "currency": "USD",
            "amount": "0.1",
            "description": "Item description",
            "invoices": null,
            "count": 2,
            "name": "device",
            "items": null
        },
        {
            "item": "ac1383dc5a8c79156f5e2a72ac889550",
            "email": "TEST@FMGUY.COM",
            "currency": "USD",
            "amount": "10",
            "description": "Just test",
            "invoices": [
                "Wxb5UxR6KR5zbAgFcioJqk",
                "NcVnVdE8fyb35rtFo1qoh7",
                "BWJR4kKVPZUeyCHHiqjLJq",
                "Ff8567Vse9XJwqAq6v956y",
                "8StXdBkePEcxpgpUVN7qEn",
                "Bp47b7Ar5d4HZkUxKqh1ef",
                "usGc9eSYadLBiE2zyBkyK",
                "W1a7qBnyXGaSGhqEbWziMp"
            ],
            "count": 0,
            "name": "test",
            "items": null
        },
        ...
    ]
}
{
    "item": "327dc71fa54d07bc28f2e81c2c79fdad",
    "amount": "0.1",
    "currency": "USD",
    "description": "Item description 2",
    "status": false,
    "invoices": [
        "KxATgNW325Zdbequy6QXbZ",
        "V3EMdbp311a79qfc1d4W7P",
        "PTt3XNLUBqZvZHu11Pn84d",
        ...
    ],
    "name": "device2",
    "count": 11
}

POST /create-item-sale

Creates new Checkout

Once you open a payment URL, a new invoice for Checkout will be generated. And after the last item (check count parameter) is paid, new invoice generation will stop and item status will change to true

0 count creates unlimited stock and new invoice generation wouldn't ever stop

It could useful for static websites without Cart system.

POST /check-item

Check Checkout details

POST /check-item-status

Check Checkout status

After the last item (check count parameter) is paid new invoice generation will stop and item status would change to true

POST /items-list

Details for All Ever Checkouts

GET /item/ + Item ID

Generate invoice for certain item or show item details (ones all paid)

POST /v2/checkout-update

Update Checkout payment details

Parameters

For /create-item-sale

Parameter In Type Required Description
trade body [string] true trade agreement id
token body [string] true token
currency body [string] true currency
amount body [string] true amount for the price
description body [string] true item description
name body [string] true item name
count body [boolean] true item availability count
email body [string] true email for notification
notification body [string] true URL for IPN (must include http or https)

For /check-item and /check-item-status

Parameter In Type Required Description
item body [string] true item id

For /items-list

Parameter In Type Required Description
trade body [string] true trade agreement id
token body [string] true token

For /v2/checkout-update

Parameter In Type Required Description
item body [string] true item id
trade body [string] true trade agreement id
token body [string] true token
description body [string] true item description
name body [string] true item name
count body [boolean] true item availability count

Response Parameters

For /create-item-sale, /check-item, /check-item-status, /v2/checkout-update

Parameter Description
item item id
amount amount for the price
description item description
status item status (changes once the last item payed)
currency currency
name body
invoices array with all generated invoices
url item payment url

For /items-list

Array with values for: item, email, currency, amount, description, invoices, count

Parameter Description
item item id
amount amount for the price
description item description
status item status (changes once the last item payed)
currency currency
name body
invoices array with all generated invoices
url item payment url

Crowdfunding or Donations

You could find in Accept payments -> Accept Donations in Dashboard

Donations

curl 'https://api.forgingblock.io/create-crowdfunding' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166&amount=9.55&currency=usd&description=Fund_description&email=test%40fastmail.mx&name=Crowdfunding_campaign_name'

curl 'https://api.forgingblock.io/check-crowdfunding' -H 'Content-Type: application/x-www-form-urlencoded' --data 'fund=58e85d60e308043559c8ac9d2efb3c7cae10'

curl 'https://api.forgingblock.io/check-crowdfunding-status' -H 'Content-Type: application/x-www-form-urlencoded' --data 'fund=58e85d60e308043559c8ac9d2efb3c7cae10'

curl 'https://api.forgingblock.io/crowdfunds-list' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166'

curl 'https://api.forgingblock.io/crowdfunding-donations' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166&fund=58e85d60e308043559c8ac9d2efb3c7cae10'

Response examples:

{
    "fund": "eae2b2aabfa7f054ccfe73f1fa2b99d94156",
    "amount": "9.55",
    "currency": "USD",
    "description": "Fund description",
    "name": "Crowdfunding_campaign_name"
}
{
    "fund": "1897676b5bc8ead155884910414dfd45f107",
    "amount": "9.55",
    "currency": "USD",
    "description": "Fund description",
    "status": false,
    "invoices": [
        "6KN6ScSsWnhwTh5AvY8VuU",
        "2fb5R9BXMGz3EYnPqJKPrk",
        "SXLG7ctaESZMgm5wfZh6RR",
        "HxPEFX2P9iSGMTYvqReFfC",
        "JsHDstR6KvZ86LY41TNv9u",
       ...
    ],
    "name": "Crowdfunding_campaign_name"
}
{
    "status": false
}
{
    "funds": [
        {
            "fund": "47285ccd8e45e887ffd4a0e79201e276cd46",
            "email": "TEST@FMGUY.COM",
            "currency": "USD",
            "amount": "9.55",
            "description": "Fund description",
            "invoices": null,
            "name": "Crowdfunding_campaign_name"
        },
        {
            "fund": "ad2588bb4e4df43ff30590a8fc5780ec84be",
            "email": "TEST@FMGUY.COM",
            "currency": "USD",
            "amount": "9.55",
            "description": "Fund description",
            "invoices": null,
            "name": "Crowdfunding_campaign_name"
        },
        ...
    ]
}
{
    "donations": [
        {
            "invoice": "5dB3RVM7nnckEwKRcvVqoQ",
            "created": "2019-10-25T14:29:32.000Z",
            "participantEmail": "1@test.me",
            "status": "complete"
        }
    ]
}

POST /create-crowdfunding

Creates new Crowdfunding

Crowdfunding used to raise certain amount. Once amount is raised crowdfunding status changes to true and GET request with fund ID and amount would stop to generatе new invoices

POST /check-crowdfunding

Check crowdfunding details

POST /check-crowdfunding-status

Check crowdfunding status

Once amount is raised crowdfunding status changes to true and GET request with fund ID and amount would stop to generating new invoices

POST /crowdfunds-list

Details for All Ever Created Crowdfunds

POST /crowdfunding-donations

Crowdfunding Donations Details

Displays private information with participants of crowdfunding (donations), includes participant email (email that was provided for the invoice)

GET /fund/ + Crowdfunding ID + / + Amount

Generates invoice for any amount to participate in the Crowdfunding

Ex. GET https://api.forgingblock.io/fund/1897676b5bc8ead155884910414dfd45f107/20 Asks for 20 USD donation

Ex. GET https://api.forgingblock.io/fund/1897676b5bc8ead155884910414dfd45f107/50 Asks for 50 USD donation

Once amount you used to create Crowdfunding is raised crowdfunding status changes to true and GET request with fund ID and amount would stop to generating new invoices

Parameters

For /create-crowdfunding

Parameter In Type Required Description
trade body [string] true trade agreement id
token body [string] true token
currency body [string] true currency
amount body [string] true amount for the price
description body [string] true crowdfunding description
name body [string] true crowdfunding campaign name
email body [string] true email for notification
notification body [string] true URL for IPN (must include http or https)

For /check-crowdfunding and /check-crowdfunding-status

Parameter In Type Required Description
fund body [string] true crowdfunding id

For /crowdfunds-list

Parameter In Type Required Description
trade body [string] true trade agreement id
token body [string] true token

For /crowdfunding-donations

Parameter In Type Required Description
trade body [string] true trade agreement id
token body [string] true token
fund body [string] true crowdfunding id

Response Parameters

For /create-crowdfunding, /check-crowdfunding and /check-crowdfunding-status

Parameter Description
fund crowdfunding id
amount amount to raise (goal)
description crowdfunding description or purpose
status crowdfunding status (changes once amount is collected)
currency currency
invoices array with all generated invoices
balance total amount collected

For /crowdfunds-list

Array with values for: Crowdfunding ID (fund), email, currency, amount, description, invoices IDs

For /crowdfunding-donations

Array with values for: Invoice ID, Invoice Creation Time, Participant's email, Invoice Status

[Advanced] Withdrawal History

Could be found as Withdrawal in Dashboard

curl 'https://api.forgingblock.io/v2/withdrawal-history' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=2GhhbL55TyYUDqadvvEEpT5AafXynVTjqqTkMHhtW7T4'

Response examples:

[
    {
        "Date": "2025-01-06T22:01:14.665Z",
        "Transaction": "3c6120687265663d2268747470733a2f2f6c696768746e696e672e666f7267696e67626c6f636b2e696f2f3f696e766f6963653d6c6e626332307531706e6863353565707035777234347539617670376e67616d78656a6173707476796d736c75327a63676a7464336e686378706579636c353967773734307164717163717a7973787172727373737035356b3632736a6c6c736e6b7230636a687373397033336870327139667135383771736c64766d783361776e686771376c6d6e767139717870717973677139636e6a646776796c3033663036333879366c3564306330346368637775777a757a686a6e326c30376473767a6864646d3663337465726a35707461636d6d3771336671633273366d67333474387535366639356b716c6c61326d336c63676d793965766d6a677138666d34387622207461726765743d225f626c616e6b222072656c3d226e6f6f70656e6572206e6f7265666572726572223e6c6e6263322e2e2e6d3438763c2f613e",
        "Recipient": "lnbc20u1pnhc55epp5wr44u9avp7ngamxejasptvymslu2zcgjtd3nhcxpeycl59gw740qdqqcqzysxqrrsssp55k62sjllsnkr0cjhss9p33hp2q9fq587qsldvmx3awnhgq7lmnvq9qxpqysgq9cnjdgvyl03f0638y6l5d0c04chcwuwzuzhjn2l07dsvzhddm6c3terj5ptacmm7q3fqc2s6mg34t8u56f95kqlla2m3lcgmy9evmjgq8fm48v",
        "StoreId": "PBQExXAXQeEB7Geu526sf3Zbe99G7efhiyKCgoDnFnJ",
        "CryptoCode": "BTC (Lightning)",
        "Amount": "0.00002"
    },
    ...
]

POST /v2/withdrawal-history

Retrieve Withdrawal History

in Response Transaction is hexified href (could be decoded from hex to string)

Parameters

Parameter In Type Required Description
trade body [string] true trade agreement id

[Advanced] Extending Invoice Expiration Time

curl 'https://api.forgingblock.io/v2/store-invoice-expiration' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=2GhhbL55TyYUDqadvvEEpT5AafXynVTjqqTkMHhtW7T4&time=60'

Response examples:

{ success: 'Updated invoice expiration time' }

POST /v2/store-invoice-expiration

Set invoice expiration time

time parameter is time in minutes, So, for example 30 is 30 minutes. Minimum value for time is 10, while maximum is 360 minutes

Parameters

Parameter In Type Required Description
trade body [string] true trade agreement id
time body [string] true time for expiration in minutes > 10 < 360

[Advanced] Attach Image to the Checkout or Crowdfunding

curl --location --request POST 'https://api.forgingblock.io/upload-image' --header 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T' --header 'Content-Type: multipart/form-data' --form 'image=@/home/test/Images/image.jpg'

curl 'https://api.forgingblock.io/get-image' -H 'Content-Type: application/x-www-form-urlencoded'  --data 'image=f1934a910f29b509b67511d2491d'

curl 'https://api.forgingblock.io/attach-image' -H 'Content-Type: application/x-www-form-urlencoded'  --data 'image=f1934a910f29b509b67511d2491d&id=d28db141cd5b2140adcc170c0d0a4147&&trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T'

Response examples:

{"image":"f1934a910f29b509b67511d2491d"}
{"base64":"iVBO...==","mimetype":"image/png"}
{"success": "Image was successfully attached to the: d28db141cd5b2140adcc170c0d0a4147"}

POST /upload-image

Upload image

Uploads image. Image could be attached later to the Checkout or Crowdfunding, uses multipart/form-data

POST /get-image

Get image mimetype and its base64 representation

POST /attach-image

Attach image id to Checkout or Crowdfunding

Attach image id to Checkout or Crowdfunding.

Every new invoice generated that has attached image would have imageId parameter in status response

[Advanced] Invoice Status

To check the status of an invoice for a specific cryptocurrency, you can use the following API structure:

General Request Format

https://api.forgingblock.io/i/{invoiceId}/{endpoint}/status?invoiceId={invoiceId}&paymentMethodId={paymentMethodId}&_={timestamp}

Where:

Example Request (ETH)

curl "https://api.forgingblock.io/i/4sXgKvGGgCwPQzMzKFRqKV/ETH/status?invoiceId=4sXgKvGGgCwPQzMzKFRqKV&paymentMethodId=ETH&_=1"

Where:

Supported Currencies

The following cryptocurrencies codes are supported:

BTC, ETH, LIGHTNING, ARB, BASE, BSC, MATIC (Polygon)

Supported Tokens

Polygon Tokens (Path: /polygon-token/)

Ethereum Tokens (Path: /eth-token/)

Path is reserved and was used for old invoices, currently Ethereum Tokens are disabled (enjoy low fee on L2)

Arbitrum Tokens (Path: /arb-token/)

Base Tokens (Path: /base-token/)

Supported Paths:

Account Control

Account Management

curl 'https://api.forgingblock.io/reset-password' -H 'Content-Type: application/x-www-form-urlencoded' --data 'email=test%40forgingblock.io'

curl 'https://api.forgingblock.io/change-email' -H 'Content-Type: application/x-www-form-urlencoded' --data 'email=test%40forgingblock.io&password=myhardpwdAeng2uabohce&newemail=test2%40forgingblock.io'

curl 'https://api.forgingblock.io/change-password' -H 'Content-Type: application/x-www-form-urlencoded' --data 'email=test%40forgingblock.io&password=AeNu3miG7nahg&newpassword=myhardpwdAeng2uabohcehhh'

Response examples:

{"success":"Check email inbox for reset link"}
{"success":"Check email inbox for email change link"}
{"success":"Password has been changed"}

POST /reset-password

Used to reset password

POST /change-email

Used to change email

POST /change-password

Used to change password

Password requirements:

Do not use common sequences or your private details, add another word or two, consider using lowercase and uppercase and special symbols

Parameters

Parameter In Type Required Description Scope
email body [string] true email reset-password, change-email, change-password
password body [string] true strong password (zxcvbn score >= 1) change-email, change-password
newpassword body [string] true new strong password (zxcvbn score >= 1) change-password
newemail body [string] true new email for password restore change-email

Account Informaton

curl 'https://api.forgingblock.io/v2/provide-business-details' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&business=forgingblock&url=https://forgingblock.io&contact=test%40forgingblock.io'
curl 'https://api.forgingblock.io/v2/update-business-details' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&business=forgingblock&url=https://forgingblock.io&contact=test%40forgingblock.io'
curl 'https://api.forgingblock.io/v2/get-business-details' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T'

Response examples:

{'success': "New business information received"}
{"business":"forgingblock3","url":"https://api.forgingblock.io"}

POST /v2/provide-business-details

Provide information about business (single run, used during Dashboard setup)

POST /v2/update-business-details

Update already provided information about business

POST /v2/get-business-details

Get information about business

Parameters

Parameter In Type Required Description Scope
trade body [string] true trade agreement id /v2/provide-business-details, /v2/update-business-details, /v2/get-business-details
business body [string] true business name /v2/provide-business-details, /v2/update-business-details
url body [string] true website information /v2/provide-business-details, /v2/update-business-details
contact body [string] true store contact email /v2/provide-business-details, /v2/update-business-details

Payment Form

Most of the payment form settings could be changed in Dashboard Account Settings

Hide Shipping Information

You could change in Dashboard Account Settings -> Payment Form

[Advanced] Default Cryptocurrency

curl 'https://api.forgingblock.io/v2/wallet-default-currency' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&currency=eth'

Response example:

{
    "success": "Default currency information updated"
}

POST /wallet-default-currency

Set default cryptocurrency for the payment form

Parameters

Parameter In Type Required Description
trade body [string] true trade agreement id
currency body [string] true cryptocurrency code

Supported cryptocurrency codes: btc, eth, ethTokensUsdt, ethTokensDai, polygon, polygonTokensDai, bsc, arb, arbTokensUsdt, arbTokensUsdc, base, baseTokensUsdc, baseTokensDai, baseTokensWeth

[Advanced] Hide Cryptocurrency

curl 'https://api.forgingblock.io/v2/wallet-hide-currency' -H 'Content-Type: application/x-www-form-urlencoded' --data 'trade=A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&currency=eth'

Response example:

{
    "success": "Hidden currency information updated"
}

POST /wallet-hide-currency

Hide cryptocurrency from the payment form

Parameters

Parameter In Type Required Description
trade body [string] true trade agreement id
currency body [string] true cryptocurrency code

Supported cryptocurrency codes: btc, eth, ethTokensUsdt, ethTokensDai, polygon, polygonTokensDai, bsc, arb, arbTokensUsdt, arbTokensUsdc, base, baseTokensUsdc, baseTokensDai, baseTokensWeth

Supported cryptocurrency codes(including supported in the past): btc, eth, ethTokensUsdt, ethTokensDai, eos, eosTokensEveripedia, trx, trxTokensUsdt, xmr, dgb, xtz, rdd, rvn, xnc, ksm, owc, tusc, polygon, polygonTokensEth, polygonTokensDai, ethTokensLusd, bsc, bscTokensWbnb, bscTokensBusd, bscTokensZina, ethTokensCrv, ethTokensPickle, ethTokensAngle, ethTokensFxs, ethTokensIdle, arb, arbTokensUsdt, arbTokensUsdc, arbTokensArb, base, baseTokensUsdc, baseTokensDai, baseTokensWeth

Integrations

E-commerce Plugins

For actual e-commerce integration information check Crypto Payment Plugins for E-Commerce page with plugins and documentation.

Shopify Integration

You could use Account Settings -> Shopify Integration in Dashboard instead

curl 'https://api.forgingblock.io/v2/add-shopify-store' -H 'Content-Type: application/x-www-form-urlencoded' \
--data 'A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166&source=https://username.myshopify.com'

curl 'https://api.forgingblock.io/v2/add-source-shopify-store' -H 'Content-Type: application/x-www-form-urlencoded' \
--data 'A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166&source=https://username2.myshopify.com'

curl 'https://api.forgingblock.io/v2/remove-source-shopify-store' -H 'Content-Type: application/x-www-form-urlencoded' \
--data 'A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166&source=https://username2.myshopify.com'

curl 'https://api.forgingblock.io/v2/get-shopify-store-source' -H 'Content-Type: application/x-www-form-urlencoded' \
--data 'A6mjm8fgDspPdoeTsXUqsLmKKA3UmNNssPA547GjcEG3T&token=769861935592995096388092186007720621311273005537151914971703166'

POST /v2/add-shopify-store

Add Shopify Store for integration (you run this only once on creation), after which you should use /add-source-shopify-store even if removed all domain URLs

Correct domain name URL examples: https://username.myshopify.com, https://username.myshopify.com/, http://username.myshopify.com, http://mystore.com, https://mystore.com, https://mystore.com/

Incorrect domain name URL examples: https://username.myshopify.com/someproductlocation, https://mystore.com/someproductlocation, mystore.com, username.myshopify.com, https://username.myshopify.com/?_cd=2263d5ac8bde3e6f61ccba03711adc43d0a1cfdcdaaf98536a99c22e3286844c&_uid=61409788069&preview_theme_id=

Parameters

Parameter In Type Required Description
trade body [string] true trade agreement id
token body [string] true token
source body [string] true Shopify Store Domain URL

POST /v2/add-source-shopify-store

Add Shopify Store Domain URL for integration

Correct domain name URL examples: https://username.myshopify.com, https://username.myshopify.com/, http://username.myshopify.com, http://mystore.com, https://mystore.com, https://mystore.com/

Incorrect domain name URL examples: https://username.myshopify.com/someproductlocation, https://mystore.com/someproductlocation, mystore.com, username.myshopify.com, https://username.myshopify.com/?_cd=2263d5ac8bde3e6f61ccba03711adc43d0a1cfdcdaaf98536a99c22e3286844c&_uid=61409788069&preview_theme_id=

Parameters

Parameter In Type Required Description
trade body [string] true trade agreement id
token body [string] true token
source body [string] true Shopify Store Domain URL

POST /v2/remove-source-shopify-store

Remove Shopify Store Domain URL from integration

Parameters

Parameter In Type Required Description
trade body [string] true trade agreement id
token body [string] true token
source body [string] true Shopify Store Domain URL to remove

POST /v2/get-shopify-store-source

Get and Array with current domain URLs for Shopify Store integration

Parameters

Parameter In Type Required Description
trade body [string] true trade agreement id
token body [string] true token

Library

If you need a library for your code check those:

Node.js library: https://www.npmjs.com/package/forgingblock.js

PHP Library: https://github.com/forgingblock/ForgingBlock-php-lib

IPN Response Example & Explanation

You could check guide section Integrate ForgingBlock Payment Gateway to your own applications and backend to get example how to handle IPN.

Also, take a look on IPN Code Sample Repo

Checkout has support for notification param for IPN URL as well