Skip to main content
POST
/
api
/
v1
/
wallets
/
trades
/
buy
Create a wallet buy trade
curl --request POST \
  --url https://payments.oaknetwork.org/api/v1/wallets/trades/buy \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 2,
  "provider": "<string>",
  "payment_method": "<string>",
  "currency": "<string>",
  "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "metadata": {}
}
'
{
  "msg": "<string>",
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "<string>",
    "type": "<string>",
    "provider": "<string>",
    "source": {
      "amount": 123,
      "currency": "<string>",
      "customer": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "payment_method": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "type": "<string>",
        "chain": "<string>"
      }
    },
    "destination": {
      "amount": 123,
      "currency": "<string>",
      "customer": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      },
      "payment_method": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "type": "<string>",
        "chain": "<string>"
      }
    },
    "metadata": {},
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "settlement_date": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Merchant authentication token. Obtained via POST /api/v1/merchant/token/grant. Pass as: Authorization: Bearer

Body

application/json
amount
integer
required
Required range: x >= 1
provider
string
required
payment_method
string
required
currency
string
required
customer_id
string<uuid>
required
metadata
object

Merchant-supplied arbitrary metadata, stored with the transaction and echoed back on derived webhook deliveries. Shape is defined by the merchant at request time.

Response

Buy trade initiated

msg
string
required

Human-readable message describing the result

data
object
required

Transaction object (field casing in response is lowercased for status, type, provider, currency)