Transfer requests

In order to process transfers, a transfer request needs to be created and signed for each transfer request and sent to Loop’s API.

Each transfer request must have its transfer details signed by a dedicated signer wallet whose address is configured in the contract. This is to ensure that none of the transfer details are changed at any point between the time they are sent to Loop and the time they are executed in the contract. See the Signing transfer requests section for details on how to sign transfer requests.

Each transfer request also has a bill date property which allows transfer requests to be submitted either for processing immediately (bill date of 0) or for processing on or after the the bill date specified.

Multiple transfer requests can be submitted in the same request.

Transfer requests must be sent by the Sunday before the intended billing date for reminders to go out.

POST//api/v1/transfers
Authorization
Header parameters
Body
invoiceId*string

The unique identifier for a given invoice from your invoice system (e.g. Stripe, Chargify)

Example: "ch_3Ljpa52eZvKYlo2C1VHbn91O"
amount*string

The amount to transfer, denominated either in USD if field usd is set to true or the given token (including decimals)

Example: "1000000000"
token*string

The address of the ERC20 token being transferred

Example: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
usd*boolean

Whether or not the amount is denominated in USD or the given token. If denominated in USD, the amount will be converted to the token amount at the time of processing. The exchange rate is retrieved from an on-chain Chainlink oracle. Conducting this conversion on-chain costs gas, thus consider only using this feature if converting from a non-stable coin (e.g. WETH).

Example: false
itemId*string

The ID of the item this transfer relates to.

Example: "a3effd58-7e10-4012-8917-329cc882f79d"
billDatenumber (double)

The approximate time at which to process the given transfer request. This needs to be formatted as a Unix timestamp in seconds. If 0, the transfer request will be processed "immediately" (as soon as the Loop bot network picks it up)

Example: 1664096943
to*string

The address receiving the transfer

Example: "0x0f2672BA12aed17BEe075F7AEabC24b98E3098Ca"
from*string

The address sending the transfer

Example: "0xad4efce746f129a9df375af2ddcf9097531eb466"
signaturestring

A signature of the above 6 parameters

Example: "0x7c4e1650d88f08e24f..."
entityId*string

The ID of the entity the payment relates to

Example: "97f41ed9-cf70-4548-b5aa-88f0083e3305"
networkId*number (double)

The network to process the given transaction on. 1: “mainnet”, 5: “goerli”, 56: “bnb”, 97: “chapel (BNB testnet)”, 137: “polygon”, 42161: “arbitrum”, 80001: “mumbai (Polygon testnet)”

Example: 5
tagIdsarray of number (double)

A list of tag IDs to associate with the transfer

notesstring

Additional comments from the transfer initiator

Response

Ok

Body
transfers*array of GeneralTransferResponse (object)
Request
const response = await fetch('//api/v1/transfers', {
    method: 'POST',
    headers: {
      "entity-id": "text",
      "Content-Type": "application/json"
    },
    body: JSON.stringify([
      {
        "invoiceId": "ch_3Ljpa52eZvKYlo2C1VHbn91O",
        "amount": "1000000000",
        "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
        "usd": false,
        "itemId": "a3effd58-7e10-4012-8917-329cc882f79d",
        "to": "0x0f2672BA12aed17BEe075F7AEabC24b98E3098Ca",
        "from": "0xad4efce746f129a9df375af2ddcf9097531eb466",
        "entityId": "97f41ed9-cf70-4548-b5aa-88f0083e3305",
        "networkId": 5
      }
    ]),
});
const data = await response.json();
Response
{
  "transfers": [
    {
      "invoiceId": "text",
      "amount": "1212",
      "token": "text",
      "usd": true,
      "itemId": "1234-5678-9012",
      "status": 3,
      "networkId": 1,
      "source": 3,
      "paymentTypeId": 1,
      "batchId": "1234-5678-9012",
      "tags": [
        "Salaries",
        "Marketing"
      ],
      "notes": "This is July's payment",
      "transferId": "1234-5678-9012",
      "entityId": "1234-5678-9012",
      "toAddress": "1234-5678-9012",
      "fromAddress": "1234-5678-9012",
      "billDate": "1701974672",
      "billDateTime": "2024-04-04T13:54:05.000Z",
      "failureMessage": "Not enough balance",
      "failureCode": "0x00000000",
      "datePaid": "1701974672",
      "datePaidDateTime": "2024-04-04T13:54:05.000Z",
      "dateCreated": "1664096943",
      "transactionHash": "0x12345998023",
      "feeAmount": "100",
      "feePaid": "1",
      "decodedSignature": {
        "s": "text",
        "r": "text",
        "v": 0
      },
      "agreementId": "a836e7ac-5bfe-4eed-aa71-7864b82bd8eb"
    }
  ]
}

Last updated