Getting started

Get started with Moola, the simplest and quickest way to keep track of transactions and balances for users of your app or service.


Introduction

Moola offers a RESTful API which makes it easy to handle the money plumbing of your application. It can be easily integrated into your project, including web applications, mobile apps and more. This documentation will help developers to integrate with Moola.


Client libraries

Although you can call the API directly, some client libraries are available which may make your development easier.


Node.js


Request an API Key

While Moola is in beta, please request an API key using the API key request form.


Help and support

If you have a question that you can't solve by looking at this documentation, please contact support. Where relevant, please include your account ID and any code samples, error messages or request IDs so that we can help you as quickly as possible.


General

Everything you need to know about your Moola integration, including authentication, handling errors and rate limiting.


Authentication

The Moola API uses API keys to authenticate requests. You will soon be able to view and manage your API keys in the Moola Dashboard. Meanwhile, please contact support if you need to revoke or renew your keys.

API Keys are specific to your application, and look like this: c152c0c2-6664-401b-96d4-fd3a860ab857.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your API keys in publicly accessible areas such as GitHub, client-side code, and so on.

For all requests, include your API key in the custom "API-Key" header. For example:

curl https://api.moola.dev/v1/wallets \
-H "API-Key: c152c0c2-6664-401b-96d4-fd3a860ab857"

All subsequent request examples in this documentation will be shown without the API-Key header specified, for readability purposes.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.


Environments

Moola does not have a sandbox mode or similar testing environment for development purposes. All requests are sent to the same production API endpoints. While you develop and test your integration, we recommend creating a non-production application through the dashboard. Once you're ready to go live, simply set up a new application and create new API keys for it.


Errors

Moola uses conventional HTTP response codes to indicate the success or failure of an API request. In general: codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g. a required parameter was omitted). Codes in the 5xx range indicate an error with Moola's servers (these are rare).

Some 4xx errors that could be handled programmatically include an error code that briefly explains the error reported.

Attributes

  • type string

    The type of error returned. One of: api_connection_error, api_error, authentication_error, idempotency_error, invalid_request_error, or rate_limit_error.

  • message string

    A human-readable message providing more details about the error.

  • code string

    For some errors that could be handled programmatically, a short string indicating the error code reported. For example:

    • balance_insufficient

      For wallets configured to prevent a negative balance, transactions which would produce a negative balance will return this error. Create a new transaction using an amount less than or equal to the wallet's balance.

    • idempotency_key_in_use

      The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously.

    • resource_missing

      The ID provided is not valid. Either the resource does not exist, or an ID for a different resource has been provided.

    • validation_failed

      The request body failed validation. Further information will be included in the errors attribute.

    • balance_negative

      The action was prevented because the wallet's balance would become negative if the operation was completed.

  • errors array

    For validation errors, an array of objects indicating the property or properties that failed validation.


Expanding objects

Many objects contain the ID of a related object in their response properties. For example, a Wallet may have an associated Holder ID. Those objects can be expanded inline using the expand request parameter. Objects that can be expanded are noted in this documentation. This parameter is available on all GET requests, and applies to the response of that request only.

For example, the following request would retrieve the wallet for the specified transaction and include it in the response body.

curl -G https://api.moola.dev/v1/transactions/txn_1DyHJ42eZvKYlo2CLM \
-d expand=wallet

You can expand multiple objects at once by identifying multiple items in the expand parameter, as a comma-separated list.


Limiting response properties

You may not always need the full representation of a resource. All GET requests allow you to specify which fields should be returned in the response body, which can minimize network traffic and help speed up your usage of the API.

Supply a fields query parameter that takes a comma-separated list of fields to include. For example, the following request would retrieve just the specified fields in a transaction:

curl -G https://api.moola.dev/v1/transactions/txn_1DyHJ42eZvKYlo2CLM \
-d fields=id,createdAt,amount

You can limit the fields of the expanded resource using dot (.) syntax. For example, in the following example, only the specified fields of the transaction wallet would be returned:

curl -G https://api.moola.dev/v1/transactions/txn_1DyHJ42eZvKYlo2CLM \
expand=wallet \
fields=id,createdAt,amount,wallet.id,wallet.name

Fields can also be excluded from your resource responses, using the exclude parameter (please note that the fields and exclude parameters are mutually exclusive, and the fields parameter will take precedence). For example, the following request would return all fields except the ones specified.

curl https://api.moola.dev/v1/transactions/txn_1DyHJ42eZvKYlo2CLM \
-d exclude=createdAt,description

Idempotent requests

The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. For example, if a request to create a transaction does not respond due to a network connection error, you can retry the request with the same idempotency key to guarantee that no more than one transaction is created.

To perform an idempotent request, provide an additional Idempotency-Key: <key> header to the request.

The API's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors.

An idempotency key is a unique value generated by the client which the server uses to recognize subsequent retries of the same request. How you create unique keys is up to you, but it is recommended to use V4 UUIDs, or another random string with enough entropy to avoid collisions. Sometimes, you may wish to use an ID from your own database, for example when creating a transaction on Moola which is 1:1 related to a row in your database, such a key may be appropriate.

Keys expire after 24 hours, so a new request is generated if a key is reused outside of that time frame. The idempotency layer compares incoming parameters to those of the original request and errors unless they're the same to prevent accidental misuse.

Results are only saved if an API endpoint started executing. If incoming parameters failed validation, or the request conflicted with another that was executing concurrently, no idempotent result is saved because no API endpoint began execution. It is safe to retry these requests.

All POST requests accept idempotency keys. Sending idempotency keys in GET and DELETE requests has no effect and should be avoided, as these requests are idempotent by definition.


Pagination

All top-level API resources have support for bulk fetches via "list" API methods. For instance, you can list Wallets, list Holders, and list Transactions and Transfrs. These list API methods share a common structure, taking at least these two parameters: limit and offset.

If you do not specify these parameters, the default value for limit will be set to 10, and the default value for offset will be set to 0. These default values may change in subsequent versions of the API, so if your logic relies on a certain response length, it is recommended to specify these parameters explicitly in your requests rather than relying on the default values. The maximum value you can specify for the limit parameter is 100.

Successful responses for such requests will include the response header Total-Count, indicating the total number of resources accessible to you, using any list filters you have specified in the query parameters.

If you specify an offset greater than the total count of resources available, the response will be an empty list, but no error will be thrown.


Request IDs

Each API request has an associated request identifier. You can find this value in the response headers, under Request-Id. If you need to contact support about a specific request, providing the request identifier will ensure the fastest possible resolution. Your client may also send a value in the Request-Id header, which will be echoed in the corresponding response.


Rate limits

To prevent abuse, and to ensure maximal availability of the API for all users, each application is limited to a maximum of 100 requests in every 1 minute period.

If you exceed this limit, your requests will receive the response status code 429 - Too Many Requests.

In order to help you keep track of your usage within a given period, all responses will include the following headers, which you can use to help prevent your application from hitting the rate limits:

  • Rate-Limit-Limit The total number of requests allowed in the current period.
  • Rate-Limit-Remaining The number of remaining requests in the current period.
  • Rate-Limit-Reset The number of seconds left in the current period.

If you believe your application is a special case and requires a higher rate limit, please contact support to request this.


Currencies

Currencies are always specified as ISO 4217 codes in lowercase. For example, United States Dollar is represented as usd.

If your application makes use of a virtual currency (for example tokens, credits or points) you can use the ISO specifier xxx.


Monetary units

Monetary units should be specified in the relevant currency's minor units, without any decimal point, value separator or delineation character. For example, GBP 1 (one pound sterling) will be represented as 100 (one hundred pence). Similarly, USD 250 (two hundred and fifty dollars) will be represented as 25000.

For zero-decimal currencies, you should still provide amounts as an integer but without multiplying by 100. For example, to charge ¥500, simply provide an amount value of 500.

If you are using a custom currency (e.g. virtual tokens, points or credits), it's up to you to choose how to handle your currency's tokens. If you do not wish to have any minor units (i.e. each token is indivisible), you can simply use 1 to represent one token.


Resources

The main resources you will interact with as part of the Moola API are explained here. This includes Holders, Wallets, Transactions and Transfers. For each, all available methods are described, alongside the resource's properties and a brief explanation of usage.


Holders

Holder objects allow you to associate Wallets to particular owners (whether individuals or businesses), which can be useful for many use cases. If your use case does not include holders, however (for example, if you are using Moola to track movement of money between virtual / internal company accounts), you may not need any Holder resources.


The holder object

Attributes
  • id string

    Unique identifier for the object.

  • name string

    Name of the holder.

  • reference string

    Reference, for example an identifier from your database.

  • defaultCurrency string

    Currency code which, by default, Wallets for this Holder should have. Specified as ISO 4217 codes in lowercase.

  • createdAt string

    Time at which the object was created. Formatted to the ISO8601 standard. Always provided as UTC.

  • updatedAt string

    Time at which the object was last updated. Formatted to the ISO8601 standard. Always provided as UTC.

  • creatorId string

    ID of the user or API key which created this object.


Create a holder

POST /v1/holders

Creates a new holder object

Arguments
  • name optional

    Name of the holder.

  • reference optional

    Reference, for example an identifier from your database.

  • defaultCurrency optional

    Currency code which, by default, Wallets for this Holder should have. Specified as ISO 4217 codes in lowercase.

Example request
curl https://api.moola.dev/v1/holders \
-d name="Walter White" \
-d reference=1972 \
-d defaultCurrency=usd \
Example response
{
  "id": "hdr_ESgEq8h3H7hOOJ",
  "name": "Walter White",
  "reference": "1972",
  "defaultCurrency": "usd",
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:44:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Retrieve a holder

GET /v1/holders/:id

Retrieves the details of an existing holder. You need only supply the unique holder identifier that was returned upon holder creation.

Arguments
  • holder ID required

    The identifier of the holder to be retrieved.

Example request
curl https://api.moola.dev/v1/holders/hdr_ESgEq8h3H7hOOJ \
Example response
{
  "id": "hdr_ESgEq8h3H7hOOJ",
  "name": "Walter White",
  "reference": "1972",
  "defaultCurrency": "usd",
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:44:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Update a holder

PATCH /v1/holders/:id

Updates the specified holder by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts the same arguments as the holder creation call.

Arguments
  • holder ID required

    The identifier of the holder to be updated.

  • name optional

    Name of the holder.

  • reference optional

    Reference, for example an identifier from your database.

  • defaultCurrency optional

    Currency code which, by default, Wallets for this Holder should have. Specified as ISO 4217 codes in lowercase.

Example request
curl -X PATCH https://api.moola.dev/v1/holders/hdr_ESgEq8h3H7hOOJ \
-d name="Heisenberg" \
Example response
{
  "id": "hdr_ESgEq8h3H7hOOJ",
  "name": "Heisenberg",
  "reference": "1972",
  "defaultCurrency": "usd",
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-11:16:21.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Delete a holder

DELETE /v1/holders/:id

Permanently deletes a holder. It cannot be undone. If the holder is associated with any Wallets, they (and all associated Transactions) will also be permanently deleted. Transfers will only be deleted if both source and target wallets have been deleted.

Arguments
  • holder ID required

    The identifier of the holder to be deleted.

Example request
curl -X DELETE https://api.moola.dev/v1/holders/hdr_ESgEq8h3H7hOOJ \
Example response

A successful response will be an empty body. The status code will be set to 204 - No Content.


Wallets

Wallet objects allow you to create "buckets" or "accounts" to which Transactions and Transfers are allocated. Optionally, Wallets can be associated with Holders. A Holder can have many Wallets, allowing you to create separate "buckets" of money or credits for each Holder. For example, your application may make use of different "states" of money (like "pending" and "available"), or you may simply wish to give a holder Wallets in various currencies.


The wallet object

Attributes
  • id string

    Unique identifier for the object.

  • holderId string

    Unique identifier for the holder to which this object belongs.

  • name string

    Name of the wallet.

  • reference string

    Reference, for example an identifier from your database.

  • currency string

    Currency code for this wallet. Specified as ISO 4217 codes in lowercase.

  • balance integer

    Integer representing the sum of all Transactions in this Wallet. This value can be negative. Represented in the wallet currency's minor units.

  • canHaveNegativeBalance boolean

    Boolean indicator of whether or not this wallet's balance is allowed to be negative (less than zero). If set to false, any attempt to create a transaction which would result in a negative balance will fail with status code 400 - Bad Request. This feature is useful if you wish to use the Moola API to enforce basic rules for transactions in your application, for example to prevent a user from spending more than the allowed balance of a giftcard.


Create a wallet

POST /v1/wallets

Creates a new wallet object

Arguments
  • holderId optional

    Unique identifier for the holder you would like to associate with this wallet.

  • name optional

    Name of the wallet.

  • reference optional

    Reference, for example an identifier from your database.

  • currency optional

    Currency code for this wallet. Specified as ISO 4217 codes in lowercase.

  • balance optional

    Integer representing the starting balance for this Wallet. This value may be positive, negative, or zero. Defaults to 0.

  • canHaveNegativeBalance boolean

    Whether or not this wallet's balance is allowed to be negative (less than zero). Defaults to true.

Example request
curl https://api.moola.dev/v1/wallets \
-d holderId="hdr_ESgEq8h3H7hOOJ" \
-d name="Walt's medical fund ;p" \
-d reference="white_001" \
-d currency=usd \
Example response
{
  "id": "wal_64008fvdbsGBv",
  "holderId": "hdr_ESgEq8h3H7hOOJ"
  "name": "Walt's medical fund ;p",
  "reference": "white_001",
  "currency": "usd",
  "balance": 0,
  "canHaveNegativeBalance": true,
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:44:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Retrieve a wallet

GET /v1/wallets/:id

Retrieves the details of an existing wallet. You need only supply the unique wallet identifier that was returned upon wallet creation.

Arguments
  • wallet ID required

    The identifier of the wallet to be retrieved.

Example request
curl https://api.moola.dev/v1/wallets/wal_64008fvdbsGBv \
Example response
{
  "id": "wal_64008fvdbsGBv",
  "holderId": "hdr_ESgEq8h3H7hOOJ"
  "name": "Walt's medical fund ;p",
  "reference": "white_001",
  "currency": "usd",
  "balance": 0,
  "canHaveNegativeBalance": true,
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:44:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Update a wallet

PATCH /v1/wallet/:id

Updates the specified wallet by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts mostly the same arguments as the wallet creation call.

Arguments
  • wallet ID required

    The identifier of the wallet to be updated.

  • name optional

    Name of the wallet.

  • reference optional

    Reference, for example an identifier from your database.

  • canHaveNegativeBalance optional

    Whether or not this wallet's balance is allowed to be negative (less than zero). Note that any attempt to set this value to false while the wallet's balance is negative will result in an 400 - Bad Request error.

Example request
curl -X PATCH https://api.moola.dev/v1/wallets/wal_64008fvdbsGBv \
-d name="RV repair fund" \
Example response
{
  "id": "wal_64008fvdbsGBv",
  "holderId": "hdr_ESgEq8h3H7hOOJ"
  "name": "RV repair fund",
  "reference": "white_001",
  "currency": "usd",
  "balance": 0,
  "canHaveNegativeBalance": true,
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:52:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Delete a wallet

DELETE /v1/wallets/:id

Permanently deletes a wallet. It cannot be undone. If the wallet is associated with any Transactions, they will also be deleted. Transfers associated with this Wallet will not be deleted, unless the corresponding source or destination wallet has also been deleted.

Arguments
  • wallet ID required

    The identifier of the wallet to be deleted.

Example request
curl -X DELETE https://api.moola.dev/v1/wallets/wal_64008fvdbsGBv \
Example response

A successful response will be an empty body. The status code will be set to 204 - No Content.


Transactions

Transaction objects allow you to track the movement of money (real or virtual) into and out of wallets. A transaction will affect the balance of the wallet it is associated with, and can be either a credit (money moving into a wallet) or debit (money moving out of a wallet) transaction. To move money between two wallets, it is preferable to use a Transfer.


The transaction object

Attributes
  • id string

    Unique identifier for the object.

  • walletId string

    Unique identifier for the wallet to which this object belongs.

  • description string

    Description of the transaction.

  • reference string

    Reference, for example an identifier from your database.

  • type string

    Either credit or debit.

  • amount integer

    Amount of the transaction, expressed in the wallet currency's minor units.

  • currency string

    Currency code for this transaction. This will always be the same as the wallet's currency, but it is included in the transaction object for convenience. Specified as ISO 4217 codes in lowercase.

  • createdAt string

    Time at which the object was created. Formatted to the ISO8601 standard. Always provided as UTC.

  • updatedAt string

    Time at which the object was last updated. Formatted to the ISO8601 standard. Always provided as UTC.

  • creatorId string

    ID of the user or API key which created this object.


Create a transaction

POST /v1/transactions

Creates a new transaction object

Arguments
  • walletId required

    ID of the wallet to which this transaction will be applied.

  • amount required

    Amount of the transaction, in the wallet currency's minor units. Must not be negative.

  • type required

    Valid values are credit or debit.

  • description string

    Description of the transaction.

  • reference string

    Reference, for example an identifier from your database.

Example request
curl https://api.moola.dev/v1/transactions \
-d walletId="wal_64008fvdbsGBv" \
-d description="Payment for Los Pollos project" \
-d reference="Pollos" \
-d amount=4000000 \
-d type=credit \
Example response
{
  "id": "txn_hbU64Fbfdde2AAd",
  "walletId": "wal_64008fvdbsGBv",
  "description": "Payment for Los Pollos project",
  "reference": "Pollos",
  "currency": "usd",
  "amount": 4000000,
  "type": "credit",
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:44:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Retrieve a transaction

GET /v1/transactions/:id

Retrieves the details of a single transaction. You need only supply the unique transaction identifier that was returned upon transaction creation.

Arguments
  • transaction ID required

    The identifier of the transaction to be retrieved.

Example request
curl https://api.moola.dev/v1/transactions/txn_hbU64Fbfdde2AAd \
Example response
{
  "id": "txn_hbU64Fbfdde2AAd",
  "walletId": "wal_64008fvdbsGBv",
  "description": "Payment for Los Pollos project",
  "reference": "Pollos",
  "currency": "usd",
  "amount": 4000000,
  "type": "credit",
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:44:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Update a transaction

PATCH /v1/transactions/:id

Updates the specified transaction by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts some of the same arguments as the transaction creation call.

Arguments
  • transaction ID required

    The identifier of the transaction to be updated.

  • description optional

    Description of the transaction.

  • reference optional

    Reference, for example an identifier from your database.

Example request
curl -X PATCH https://api.moola.dev/v1/transactions/txn_hbU64Fbfdde2AAd \
-d description="Payment for delicious chicken dinner at Los Pollos" \
Example response
{
  "id": "txn_hbU64Fbfdde2AAd",
  "walletId": "wal_64008fvdbsGBv",
  "description": "Payment for delicious chicken dinner at Los Pollos",
  "reference": "Pollos",
  "currency": "usd",
  "amount": 4000000,
  "type": "credit",
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:44:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Delete a transaction

DELETE /v1/transactions/:id

Permanently deletes a transaction. It cannot be undone. Note that it is usually preferable to create a "contra" transaction to reverse the effect of a given transaction.

Arguments
  • transaction ID required

    The identifier of the transaction to be deleted.

Example request
curl -X DELETE https://api.moola.dev/v1/transactions/txn_hbU64Fbfdde2AAd \
Example response

A successful response will be an empty body. The status code will be set to 204 - No Content.


Transfers

Transfer objects represent the movement of money (real or virtual) between two wallets. A transfer will affect the balance of the source and destination Wallets it is associated with.


The transfer object

Attributes
  • id string

    Unique identifier for the object.

  • sourceWalletId string

    Unique identifier for the wallet from which this transfer originates.

  • targetWalletId string

    Unique identifier for the wallet to which this transfer moves money.

  • description string

    Description of the transfer.

  • reference string

    Reference, for example an identifier from your database.

  • sourceAmount integer

    Amount of the transaction, expressed in the source wallet's currency's minor units.

  • targetAmount integer

    Amount of the transaction, expressed in the target wallet's currency's minor units.

  • sourceCurrency string

    Currency code for this transfer's source wallet, which is included in the transfer object for convenience. Specified as ISO 4217 code in lowercase.

  • targetCurrency string

    Currency code for this transfer's target wallet, which is included in the transfer object for convenience. Specified as ISO 4217 code in lowercase.

  • conversionRate number

    Conversion rate used for this transfer. Expressed as a decimal number usually up to 6 decimal places (e.g. 0.870342) but in unusual cases, up to 14 decimal places (e.g. 0.00000000539327). The source currency is used as the base currency. For example, a transfer for a EUR wallet to a GBP wallet might have a conversion rate of 0.882047. In cases where a transfer is made between wallets with the same currency, the conversion rate value will be 1.

  • createdAt string

    Time at which the object was created. Formatted to the ISO8601 standard. Always provided as UTC.

  • updatedAt string

    Time at which the object was last updated. Formatted to the ISO8601 standard. Always provided as UTC.

  • creatorId string

    ID of the user or API key which created this object.


Create a transfer

POST /v1/transfers

Creates a new transfer object

Arguments
  • sourceWalletId required

    ID of the wallet from which money will be moved.

  • targetWalletId required

    ID of the wallet to which money will be moved.

  • sourceAmount required

    Amount of the transfer, in the source wallet currency's minor units. Must not be negative.

  • targetAmount conditional

    Amount of the transfer, in the target wallet currency's minor units. Must not be negative. Required if the source and target wallets have different currencies, and the conversionRate parameter is not set.

  • conversionRate conditional

    The conversion rate of the transfer, using the source wallet currency as the base currency. Expressed as a decimal number, up to 15 decimal places.

    This field is required if the transfer is between wallets with different currencies and the targetAmount parameter is not set. Note that if the targetAmount parameter is set, the conversionRate parameter will be ignored if set, and a value will be calculated for you according to the specified source and target amounts in their respective currencies. If both wallets have the same currency, this field is optional, but if set the only valid value is 1.

  • description string

    Description of the transfer.

  • reference string

    Reference, for example an identifier from your database.

Example request
curl https://api.moola.dev/v1/transfers \
-d sourceWalletId="wal_64008fvdbsGBv" \
-d targetWalletId="wal_Ejbb54Dhbcde1" \
-d description="Movement of funds to London (sterling) account" \
-d sourceAmount=2500000 \
-d conversionRate=0.77 \
-d reference="P0ll05" \
Example response
{
  "id": "tfr_hbU64Fbfdde2AAd",
  "sourceWalletId": "wal_64008fvdbsGBv",
  "targetWalletId": "wal_Ejbb54Dhbcde1",
  "description": "Movement of funds to London (sterling) account",
  "reference": "P0ll05",
  "sourceCurrency": "usd",
  "targetCurrency": "gbp",
  "sourceAmount": 2500000,
  "targetAmount": 1915200,
  "conversionRate": 0.77,
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:44:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Retrieve a transfer

GET /v1/transfers/:id

Retrieves the details of a single transfer. You need only supply the unique transfer identifier that was returned upon transfer creation.

Arguments
  • transfer ID required

    The identifier of the transfer to be retrieved.

Example request
curl https://api.moola.dev/v1/transfers/tfr_hbU64Fbfdde2AAd \
Example response
{
  "id": "tfr_hbU64Fbfdde2AAd",
  "sourceWalletId": "wal_64008fvdbsGBv",
  "targetWalletId": "wal_Ejbb54Dhbcde1",
  "description": "Movement of funds to London (sterling) account",
  "reference": "P0ll05",
  "sourceCurrency": "usd",
  "targetCurrency": "gbp",
  "sourceAmount": 2500000,
  "targetAmount": 1915200,
  "conversionRate": 0.77,
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:44:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Update a transfer

PATCH /v1/transfers/:id

Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts some of the same arguments as the transfer creation call.

Arguments
  • transfer ID required

    The identifier of the transfer to be updated.

  • description optional

    Description of the transfer.

  • reference optional

    Reference, for example an identifier from your database.

Example request
curl -X PATCH https://api.moola.dev/v1/transfers/tfr_hbU64Fbfdde2AAd \
-d description="Going to London to see the Queen" \
Example response
{
  "id": "tfr_hbU64Fbfdde2AAd",
  "sourceWalletId": "wal_64008fvdbsGBv",
  "targetWalletId": "wal_Ejbb54Dhbcde1",
  "description": "Going to London to see the Queen",
  "reference": "P0ll05",
  "sourceCurrency": "usd",
  "targetCurrency": "gbp",
  "sourceAmount": 2500000,
  "targetAmount": 1915200,
  "conversionRate": 0.77,
  "createdAt": "2019-01-04T22:44:30.652Z",
  "updatedAt": "2019-01-04T22:44:30.652Z",
  "creatorId": "usr_4n5pxq24kpiob12og9"
}

Delete a transfer

DELETE /v1/transfers/:id

Permanently deletes a transfer. It cannot be undone. Note that it is usually preferable to create a "contra" transfer to reverse the effect of a given transfer.

Arguments
  • transfer ID required

    The identifier of the transfer to be deleted.

Example request
curl -X DELETE https://api.moola.dev/v1/transfers/tfr_hbU64Fbfdde2AAd \
Example response

A successful response will be an empty body. The status code will be set to 204 - No Content.