Redeem vouchers
POST/voucher/redeem/
Spend one or multiple vouchers for the selected amount and asset. If some change is produced, a new voucher worth that amount is created.
Request
- application/json
Body
Possible values: [crypto
, sepa
, swift
, us
]
required if destination_type
is 'crypto'
required if destination_type
is 'sepa' or 'swift'
required if destination_type
is 'sepa' or 'swift'
required if destination_type
is 'swift' or 'us'
required if destination_type
is 'us'
Responses
- 200
The order representing the redeemed vouchers and the eventual voucher created for the change.
- application/json
- Schema
- Example (from schema)
- Example
Schema
order object
Possible values: [WAITING_FOR_DEPOSIT
, DEPOSIT_RECEIVED
, DEPOSIT_CONFIRMED
, APPROVED
, COMPLETED
, CANCELED
, EXPIRED
, REJECTED
, REFUNDED
]
not null if from_asset
is 'crypto'
not null if from_asset
is 'fiat'
not null if from_asset
is 'fiat'
not null if from_asset
is 'fiat'
not null if from_asset
is 'EUR'
not null if from_asset
is 'EUR'
not null if from_asset
is 'fiat'
not null if from_asset
is 'fiat'
funding object
trade object
voucher object
{
"order": {
"id": "string",
"status": "WAITING_FOR_DEPOSIT",
"email": "user@example.com",
"refund_crypto_address": "string",
"created_at": "string",
"approved_at": "string",
"completed_at": "string",
"deposit_crypto_address": "string",
"deposit_bank_address": "string",
"deposit_bank_name": "string",
"deposit_beneficiary": "string",
"deposit_beneficiary_address": "string",
"deposit_sepa_address": "string",
"deposit_swift_address": "string",
"deposit_swift_intermediary_address": "string",
"from_amount": 0,
"from_asset": "string",
"to_asset": "string",
"funding": {
"vouchers": [
null
]
}
},
"trade": {
"from_amount": 0,
"from_asset": "string",
"to_amount": 0,
"to_asset": "string",
"fee_amount": 0,
"price": 0,
"timestamp": "string"
},
"voucher": {
"code": "string",
"amount": 0
}
}
{
"order": {
"id": "38ba2f7f-a8fa-4dc7-a929-f3063fba5a80",
"status": "COMPLETED",
"email": "user@example.com",
"created_at": "2023-12-01T11:29:37.532063Z",
"approved_at": "2023-12-01T11:29:37.532063Z",
"completed_at": "2023-12-01T11:29:37.532063Z",
"from_amount": 1600,
"from_asset": "LEAF",
"to_asset": "CHF",
"funding": {
"vouchers": [
"3f65c9e141399ec1c6500fe745852d5aee35cca73bc2256237bc82763ad92bc2"
]
},
"deposit_amount": 1600
},
"trade": {
"from_amount": 1000,
"from_asset": "LEAF",
"to_amount": 900,
"to_asset": "CHF",
"fee_amount": 100,
"price": 0.9,
"timestamp": "2023-12-01T11:29:37.532063Z"
},
"voucher": {
"code": "3b8f918f-b09f-4dfa-84f8-635dff2f9df0",
"amount": 600
}
}