The token owner can reject any offer raised by a buyer. This process involves two APIs:
- initiateRejectOffer: This API fetches the offer details required to initiate the rejection of the offer.
- rejectOffer: After the front-end successfully processes the rejection transaction using Phantom or Backpack wallet, the
rejectOffer
API is called to confirm the rejection and finalize the transaction.
Sample mutations
mutation initiateRejectOfferMutation($orderId: UUID1!, $orgId: UUID1!, $walletAddress: String!) {
initiateRejectOffer(
orderId: $orderId
orgId: $orgId
walletAddress: $walletAddress
) {
seller
sellerTokenAccount
buyer
offer
offerEscrow
systemProgram
descriminator
mintAccount
__typename
}
}
mutation rejectOffer($orderId: UUID1!, $orgId: UUID1!, $walletAddress: String, $currency: CurrencyCodeFiat, $signature: String) {
rejectOffer(
orderId: $orderId
orgId: $orgId
walletAddress: $walletAddress
currency: $currency
signature: $signature
)
}
Sample variables
{
"orgId": "0db10bbf-85fe-4c87-911b-d18f8568fc07",
"orderId": "e1d81933-37bc-4d86-bc01-ad33551d3930",
"walletAddress": "7GckBHDKCMEdFdnxJV3qY12YCEVop6MKtgjVAnd7vHGD"
}
{
"orgId": "0db10bbf-85fe-4c87-911b-d18f8568fc07",
"orderId": "e1d81933-37bc-4d86-bc01-ad33551d3930",
"signature": "Z1PzeujwWby4VTGjVNo3BJrqZZCYzSn3KghzwKZctP4nZyR3Fx3ZqMnXoCihMHDHd4QTVzgtsb6bEtQPMZQca3E",
"walletAddress": "7GckBHDKCMEdFdnxJV3qY12YCEVop6MKtgjVAnd7vHGD",
"currency": "USD"
}
Sample response
{
"data": {
"initiateRejectOffer": {
"seller": "7GckBHDKCMEdFdnxJV3qY12YCEVop6MKtgjVAnd7vHGD",
"sellerTokenAccount": "D5RsufniFeb1zEygWM1SZ4kg2oxnFS8A67dvhjtWvToD",
"buyer": "AhE1ubLPzT6vY1rWFoPko5DSC3rpQUhLMjdEiWV1mJGh",
"offer": "KPnBmvtFVaRyeFEPUWzUjqsj86zqt4qaFcKCDFbofrz",
"offerEscrow": "4aRpxWDMLu9ZfYYFYPng2PnyUancWcZipkFhVHRxLREY",
"systemProgram": "11111111111111111111111111111111",
"descriminator": [
154,
107,
238,
8,
171,
64,
222,
56
],
"mintAccount": "FytWTAobotGfihugTU8TEQzEgjfrttUVNWcRHv1GG2G3",
"__typename": "RejectOfferResponse"
}
}
}
{
"data": {
"rejectOffer": "Offer rejected."
}
}
Fields
The table below provides an explanation of each variable in the respective column.
initiateRejectOffer:
Name | Type | Description |
---|---|---|
orgId | UUID1 | The organization ID. |
orderId | UUID1 | The offer order ID. |
walletAddress | String | The owner's wallet address. |
rejectOffer:
Name | Type | Description |
---|---|---|
orgId | UUID1 | The organization ID. |
orderId | UUID1 | The offer order ID. |
signature | String | The reject offer transaction hash. |
walletAddress | String | The owner's wallet address. |
currency | Enum | This currency is used to show the currency conversion rate of fiat currency amount. |