Borderless Docs
  • Get Started
    • Welcome to Borderless
    • Quick Start
  • About us
    • About us
      • Supported countries
  • Reference
    • API Reference
      • Authentication
      • Users
      • KYC
      • Rates
      • Orders
      • Webhooks
Powered by GitBook
On this page
  1. Reference
  2. API Reference

Orders

PreviousRatesNextWebhooks

Last updated 1 year ago

You need a Rate Code first: In order to create an order, you need to provide a Rate Code, this Rate will contain information about the amounts and currencies for the Order.

Find required fields to create an Order

Create an Order

Before creating a new Order, you must know what sender and receiver details fields are required for a pair of currencies. Both (sender and receiver) might need personDetails, financialDetails and orderDetails.

Get an Order by ID

Get all orders for the user

Cancel an Order by ID

Find a Order by ID

get
Authorizations
Path parameters
idnumberRequired
Responses
200
The found Order
application/json
401
Unauthorized
500
Internal server error
get
GET /order/{id} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
{
  "id": 1,
  "userId": 1,
  "amountIn": 100,
  "amountOut": 100,
  "fiatIn": "CAD",
  "fiatOut": "PHP",
  "serviceFee": 10,
  "status": "PENDING USER"
}

Find all Orders for a user

get
Authorizations
Query parameters
maxAmountnumber · min: 1OptionalDefault: 100000
minAmountnumber · min: 1OptionalDefault: 1
statusstring · enumOptionalPossible values:
orderstring · enumOptionalDefault: ASCPossible values:
pagenumber · min: 1OptionalDefault: 1
takenumber · min: 1 · max: 50OptionalDefault: 10
Responses
200
The list of Orders for that user
application/json
401
Unauthorized
500
Internal server error
get
GET /order/all HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
{
  "data": [
    {
      "id": 1,
      "userId": 1,
      "amountIn": 100,
      "amountOut": 100,
      "fiatIn": "CAD",
      "fiatOut": "PHP",
      "serviceFee": 10,
      "status": "PENDING USER"
    }
  ],
  "meta": {
    "page": 1,
    "take": 1,
    "itemCount": 1,
    "pageCount": 1,
    "hasPreviousPage": true,
    "hasNextPage": true
  }
}

Cancel a order by ID

patch
Authorizations
Path parameters
idnumberRequired
Responses
200
Ok
401
Unauthorized
500
Internal server error
patch
PATCH /order/cancel/{id} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*

No content

  • Find required fields to create an Order
  • GETFind order requirements
  • Create an Order
  • POSTCreate a new Order
  • Get an Order by ID
  • GETFind a Order by ID
  • Get all orders for the user
  • GETFind all Orders for a user
  • Cancel an Order by ID
  • PATCHCancel a order by ID

Find order requirements

get
Authorizations
Body
sendFiatstring · enumRequired

FIAT currency user wants to send

Example: CADPossible values:
receiveFiatstring · enumRequired

FIAT currency that will be received

Example: PHPPossible values:
Responses
200
Required fields to create an order
application/json
401
Unauthorized
500
Internal server error
get
GET /order/intent HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 38

{
  "sendFiat": "CAD",
  "receiveFiat": "PHP"
}
{
  "rateCode": "A valid rate code provided by the app",
  "senderDetails": {
    "personDetails": {
      "emailAddress": {
        "description": "Email address"
      },
      "firstName": {
        "description": "Family or last name"
      },
      "lastName": {
        "description": "Given or first name"
      },
      "address": {
        "description": "Entire address (country, state, postal code, street address, etc...) as a multi-line string"
      },
      "country": {
        "description": "Name of country"
      },
      "city": {
        "description": "Name of city/town"
      },
      "stateOrProvince": {
        "description": "Name of state/province/region/prefecture"
      },
      "idCountryCode": {
        "description": "Country issuing passport or photo ID as ISO 3166-1 alpha-3 code"
      },
      "postalCode": {
        "description": "Postal or other code identifying user's locale"
      }
    },
    "financialDetails": {
      "bankAccountNumber": {
        "description": "Number identifying bank account"
      },
      "bankCode": {
        "description": "Bank code to determine which bank the funds will arrive at"
      },
      "holderName": {
        "description": "Bank account holder name"
      }
    },
    "orderDetails": {
      "purpose": {
        "description": "Purpose or reason for this transaction"
      },
      "relationshipWithBeneficiary": {
        "description": "Relationship with beneficiary"
      },
      "method": {
        "description": "Method of payment: PAY-TO-ACCOUNT-REAL-TIME or PAY-TO-ACCOUNT-NON-REAL-TIME "
      }
    }
  },
  "receiverDetails": {
    "personDetails": {
      "emailAddress": {
        "description": "Email address"
      },
      "firstName": {
        "description": "Family or last name"
      },
      "lastName": {
        "description": "Given or first name"
      },
      "address": {
        "description": "Entire address (country, state, postal code, street address, etc...) as a multi-line string"
      },
      "country": {
        "description": "Name of country"
      },
      "city": {
        "description": "Name of city/town"
      },
      "stateOrProvince": {
        "description": "Name of state/province/region/prefecture"
      },
      "idCountryCode": {
        "description": "Country issuing passport or photo ID as ISO 3166-1 alpha-3 code"
      },
      "postalCode": {
        "description": "Postal or other code identifying user's locale"
      }
    },
    "financialDetails": {
      "bankAccountNumber": {
        "description": "Number identifying bank account"
      },
      "bankCode": {
        "description": "Bank code to determine which bank the funds will arrive at"
      },
      "holderName": {
        "description": "Bank account holder name"
      }
    },
    "orderDetails": {
      "purpose": {
        "description": "Purpose or reason for this transaction"
      },
      "relationshipWithBeneficiary": {
        "description": "Relationship with beneficiary"
      },
      "method": {
        "description": "Method of payment: PAY-TO-ACCOUNT-REAL-TIME or PAY-TO-ACCOUNT-NON-REAL-TIME "
      }
    }
  }
}

Create a new Order

post
Authorizations
Body
rateCodestringRequired

The Rate code that contains the currencies and amounts of the order

Example: AHOQWIRTZXV12
senderDetailsall ofRequired

Details of the sender

receiverDetailsall ofRequired

Details of the Receiver

Responses
200
The created Order
application/json
401
Unauthorized
500
Internal server error
post
POST /order HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 1040

{
  "rateCode": "AHOQWIRTZXV12",
  "senderDetails": {
    "personDetails": {
      "firstName": "John",
      "lastName": "Doe",
      "address": "123 Main Street",
      "city": "Toronto",
      "stateOrProvince": "Ontario",
      "idCountryCode": "CAN",
      "country": "Canada",
      "postalCode": "18934"
    },
    "financialDetails": {
      "bankCountryId": "CAN",
      "bankName": "BBVA",
      "holderName": "John Doe",
      "bankRoutingNumber": "123-45678",
      "bankAccountNumber": "3456789",
      "achCode": "ACH",
      "swiftBicCode": "SWIFT"
    },
    "orderDetails": {
      "purpose": "Gift",
      "relationshipWithBeneficiary": "Colleague",
      "method": "PAY-TO-ACCOUNT-REAL-TIME"
    }
  },
  "receiverDetails": {
    "personDetails": {
      "firstName": "John",
      "lastName": "Doe",
      "address": "123 Main Street",
      "city": "Toronto",
      "stateOrProvince": "Ontario",
      "idCountryCode": "CAN",
      "country": "Canada",
      "postalCode": "18934"
    },
    "financialDetails": {
      "bankCountryId": "CAN",
      "bankName": "BBVA",
      "holderName": "John Doe",
      "bankRoutingNumber": "123-45678",
      "bankAccountNumber": "3456789",
      "achCode": "ACH",
      "swiftBicCode": "SWIFT"
    },
    "orderDetails": {
      "purpose": "Gift",
      "relationshipWithBeneficiary": "Colleague",
      "method": "PAY-TO-ACCOUNT-REAL-TIME"
    }
  }
}
{
  "id": 1,
  "userId": 1,
  "amountIn": 100,
  "amountOut": 100,
  "fiatIn": "CAD",
  "fiatOut": "PHP",
  "serviceFee": 10,
  "status": "PENDING USER"
}