Sell Liquidity
Interacting as a seller on the Magma marketplace.
This page covers the three seller operations: Accept, Reject, and Confirm Channel Opening. All of these are authenticated endpoints, so you’ll need an API key.
When working with orders, make sure the order is in the right status before sending your mutation (see each section for details). Also ensure any invoice you provide has an expiry of more than 48 hours.
1. Accept an Order
Accept an order that is open for one of your offers. The order must be in WAITING_FOR_SELLER_APPROVAL status.
mutation AcceptOrder($sellerAcceptOrderId: String!, $request: String!) {
sellerAcceptOrder(id: $sellerAcceptOrderId, request: $request)
}
}Click here to open the query in the Apollo Explorer.
Variables
{
"sellerAcceptOrderId": "ORDER_ID",
"request": "BOLT11_LIGHTNING_REQUEST"
}2. Reject an Order
Reject an order that is open for one of your offers. The order must be in WAITING_FOR_SELLER_APPROVAL status.
mutation SellerRejectOrder($sellerRejectOrderId: String!) {
sellerRejectOrder(id: $sellerRejectOrderId)
}Click here to open the query in the Apollo Explorer
Variables
{
"sellerRejectOrderId": "ORDER_ID"
}3. Confirm Channel Opening
Confirm a channel opening by sending us the opening transaction id. The order must be in WAITING_FOR_CHANNEL_OPEN status.
The transaction must include the output in this format: TRANSACTION_ID:TRANSACTION_OUTPUT
mutation SellerAddTransaction(
$sellerAddTransactionId: String!
$transaction: String!
) {
sellerAddTransaction(id: $sellerAddTransactionId, transaction: $transaction)
}Click here to open the query in the Apollo Explorer
Variables
{
"sellerAddTransactionId": "ORDER_ID",
"transaction": "TRANSACTION_ID:TRANSACTION_OUTPUT"
}