Skip to content

Allocations

List allocations for a transaction

All allocations associated with a transaction are queried through the transaction query.

query transaction {
transaction(id: "4XTwDsioZZZFeOKKr5blO") {
id
allocations {
id
value
state
calculation {
value
payout
fee
refund
}
}
}
}

View an allocation

An individual allocation can be retrieved using the allocation query

query allocation {
allocation(id: "15uLJNN9PfXyS1Tj086RAM") {
id
value
state
calculation {
value
payout
fee
refund
}
}

Start Delivery

The allocationStartDelivery mutation is used to initiate delivery this can only be called when the transaction is in the FUNDS_RECEIVED or INITIATED states

mutation allocationStartDelivery {
allocationStartDelivery(id: "4RwHQ1bQsmA5v4tjf5o0m6") {
id
state
}
}

Amend allocation

Allocations can be amended if the terms of the transaction are not met, for example providing a partial refund. However, an allocation can only be amended after delivery started is called between allocationStartDelivery and allocationAcceptDelivery

See the amendments section for more information.

Managing Delivery Confirmations

Delivery In Transit

When an allocation is in the process of been delivered (i.e. with a courier) the allocationInTransit can be called. This will add a delay using the number days to deliver before automatically triggering a notification to the buyer giving them 24 hours to accept or dispute the transaction.

mutation allocationInTransit {
allocationCompleteDelivery(id: "4RwHQ1bQsmA5v4tjf5o0m6") {
id
state
}
}

Complete Delivery

When an allocation has been delivered the allocationCompleteDelivery should be called. This will trigger a notification to the buyer giving them 24 hours to accept or dispute the transaction.

mutation allocationCompleteDelivery {
allocationCompleteDelivery(id: "4RwHQ1bQsmA5v4tjf5o0m6") {
id
state
}
}

Accept Delivery

When an allocation is ready to be paid out the allocationAcceptDelivery should be called. This will trigger a payout to the seller, and a refund if the allocation has been amended.

Once all allocations are accepted payouts to 3rd parties just such as agents and beneficiaries will be made.

mutation allocationAcceptDelivery {
allocationAcceptDelivery(id: "4RwHQ1bQsmA5v4tjf5o0m6") {
id
state
}
}

Dispute Delivery

The allocationDisputeDelivery is called if there is a material issue between the buyer and seller that cannot be resolved and can only be called after allocationStartDelivery is called.

At this point the relevant parties will need to use the TradeSafe App to continue the transaction.

mutation allocationDisputeDelivery {
allocationDisputeDelivery(id: "4RwHQ1bQsmA5v4tjf5o0m6") {
id
state
}
}