Buy / Sweep

A Route that can initiate purchasing requests for any inscription listed on your platform

Good To Know: - If Bulk Buy / Sweep Mode has not been supported in your site, please skip this chapter, it's optional for the integration.

- The Body block here means the element body of the final array[], not the final request body, just for easier representation.

Bulk Buy Step 1 (Generate unsigned PSBT)

POST https://api.yourapi.com/bulk_buy/gen_unsigned_psbt

Request Body

Name
Type
Description

order_id*

String

The UUID of the listing order

payment_address*

String

Buyer BTC Wallet Address for payment

payment_public_key*

String

The public key or tapInternalKey of the buyer wallet

receive_address*

String

Buyer BTC Wallet Address for receiving the inscription

{
    "unsigned_psbt": "cHNidP8BAF4BAAAAAUJ9La+ofAcuISttLELIa/MXlpzwhespMW3ncsblUULSAAAAAAD9////AQ4LFAAAAAAAIlEgTXuI2GtwF3O204wqZnFkvNx8Pyg2bvXvHcPNPN+ZB7MAAAAAAAEA/TgBAgAAAAABAhgW2s7AuZds0CxpIxl0EpVI+ICBTDDUjpgjUwVX1WKUAAAAAAD/////qbOsCyU0AmFToZTt/L/yFx3u8G45ZV7nQ2qVKThQK0QBAAAAAP////8CLgwAAAAAAAAiUSBNe4jYa3AXc7bTjCpmcWS83Hw/KDZu9e8dw80835kHs/IIAAAAAAAAIlEgTXuI2GtwF3O204wqZnFkvNx8Pyg2bvXvHcPNPN+ZB7MBQPoPo1+VXSpwZVIhHFYAW7i3MhiQx90td5g9ZDq45CjHiojlRXccFe5wdpITvSeJhLtVifqxInd+dAfkvuKFJaQBQIZWeKzeyN9VqtOvCBcb4OOWeLYhOd5VoINqnSLenKhOGas1+ES2XkX0j6GQS9Wzdf2F7uQ3q34EZcYp3ORyyJoAAAAAAQErLgwAAAAAAAAiUSBNe4jYa3AXc7bTjCpmcWS83Hw/KDZu9e8dw80835kHswEDBIMAAAABFyBmCFHvbyWKZACC2mhNG83L5ZknaX18ujmA2/wP55dXyAAA", // Base64 format of a PSBT object
}

Bulk Buy Step 2 (Send back the signed PSBT)

POST https://api.yourapi.com/bulk_buy/signed_psbt_callback

Request Body

Name
Type
Description

signed_psbt*

String

Signed PSBT by client side. Double check with the unsigned PSBT saved in DB by last step

payment_public_key

String

The public key or tapInternalKey of the buyer wallet. Double check with the parsed PSBT

payment_address

String

Buyer BTC Wallet Address for payment. Double check with the parsed PSBT

Good To Know: - If Bulk Buy / Sweep Mode has been supported in your site, no need to implement a extra Single Buy endpoint for us.

Single Buy Step 1 (Generate unsigned PSBT)

POST https://api.yourapi.com/buy/{inscription_id}/gen_unsigned_psbt

Path Parameters

Name
Type
Description

inscription_id*

String

The identifier of the listed inscription, which is generated by Ordinals protocol. Such as e583ba055949cd05bb145249b20dd5076cb81d46e0bb84158a17305fcc77aa05i0

Request Body

Name
Type
Description

order_id*

Int

The UUID of the listing order

payment_address*

String

Buyer BTC Wallet Address for payment

payment_public_key*

String

The public key or tapInternalKey of the buyer wallet

receive_address*

String

Buyer BTC Wallet Address for receiving the inscription

Single Buy Step 2 (Send back the signed PSBT)

POST https://api.yourapi.com/buy/{inscription_id}/signed_psbt_callback

Path Parameters

Name
Type
Description

inscription_id*

String

The identifier of the listed inscription, which is generated by Ordinals protocol. Such as e583ba055949cd05bb145249b20dd5076cb81d46e0bb84158a17305fcc77aa05i0

Request Body

Name
Type
Description

signed_psbt*

String

Signed PSBT by client side. Double check with the unsigned PSBT saved in DB by last step

order_id*

String

The UUID of the listing order

payment_address

String

Buyer BTC Wallet Address for payment. Double check with the parsed PSBT

payment_public_key

String

The public key or tapInternalKey of the buyer wallet. Double check with the parsed PSBT

Last updated

Was this helpful?