# Link.acceptOffer

## Link.acceptOffer

LINK REFERENCE TOOL

Check out our <mark style="color:blue;">**Link reference tool**</mark> to understand how `Link` methods work without having to write any code.

Here's how you can accept an offer:

```
import { XpansionChainOrderStatus, XpansionChainClient, Link } from '@imtbl/imx-sdk';
// Pass orderAndTradeAPI version parameter as 'v3' to target the latest version of order & trade API.
const link = new Link('https://link.sandbox.x.XpansionChain.com', null, 'v3');
// accept an offer by passing the orderId of the offer
await link.acceptOffer({
  orderId: '940',
  fees: [
    // optionally specify seller marketplace fees in array
    {
      address: '0x383b14727ac2bD3923f1583789d5385C3A26f91E',
      fee_percentage: 0.5, // equal to 0.5%
    },
  ],
});
```

Just like all other link SDK methods, **acceptOffer** returns a promise, which resolves once all operations are complete, or rejects once the link encounters a critical error.

Input parameters:

```
{
  orderId: string, // order id of the offer to be accepted
  fees?: {
    address: string, // recipient eth address
    fee_percentage: number, // fee percentage
  }[] // optionally specify seller marketplace fees in array
}
```

![Accept an offer](https://3017072639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7a6afyDwSEkvWtt1UhmH%2Fuploads%2FYK0NhfjNVBe7Ce7hViAe%2F1.png?alt=media\&token=5869a95b-3a4b-44a4-b192-654f58a3738b)

![Accept an offer confirmation](https://3017072639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7a6afyDwSEkvWtt1UhmH%2Fuploads%2FJxMTMejC8pKgYIuY5eQD%2F2.png?alt=media\&token=4b3409a3-a3dc-41fe-9377-69c4fe1fd313)

### Errors[​](https://docs.x.immutable.com/docs/x/link-accept-offer#errors) <a href="#errors" id="errors"></a>

See error responses <mark style="color:blue;">here</mark>.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xpansionchain-1.gitbook.io/xpansionchain/advanced-guides/link-sdk/offers/link.acceptoffer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
