Skip to main content
POST
/
api
/
v1
/
invoice
/
pay
Send invoice to be processed
curl --request POST \
  --url https://demo.api.loopcrypto.xyz/api/v1/invoice/pay \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --header 'entity-id: <api-key>' \
  --data '{
  "invoiceId": "d5f55138-881f-406d-bfa0-a574be64cf49",
  "externalInvoiceId": "in_123490aa"
}'
{
  "id": "1234-5678-9012",
  "invoiceId": "<string>",
  "elements": {
    "elements": [
      {
        "id": "1234-5678-9012",
        "agreementInvoiceID": "<string>",
        "quantity": 1,
        "name": "<string>",
        "amount": 1999,
        "discountAmount": 1.99,
        "createdDate": "1664096943"
      }
    ]
  },
  "agreementId": "<string>",
  "amount": "1212",
  "token": "<string>",
  "usd": true,
  "status": 3,
  "networkId": 1,
  "source": 3,
  "tags": [
    "Salaries",
    "Marketing"
  ],
  "notes": "This is July's payment",
  "entityId": "1234-5678-9012",
  "toAddress": "1234-5678-9012",
  "fromAddress": "1234-5678-9012",
  "billDate": "1701974672",
  "billDateTime": "Mon Oct 16 2023 21:41:59 GMT+0000 (Coordinated Universal Time)",
  "paidDate": "1701974672",
  "paidDateTime": "Mon Oct 16 2023 21:41:59 GMT+0000 (Coordinated Universal Time)",
  "createdDate": "1664096943",
  "decodedSignature": {
    "s": "<string>",
    "r": "<string>",
    "v": 123
  },
  "attemptCount": 123,
  "firstAttemptDate": 123,
  "lastAttemptDate": 123,
  "transactionHash": "<string>"
}

Authorizations

api-key
string
header
required
entity-id
string
header
required

Body

application/json
invoiceId
string

The Loop invoice ID to pay

Example:

"d5f55138-881f-406d-bfa0-a574be64cf49"

externalInvoiceId
string

The Stripe invoice ID to pay. Should start with "in_".

Example:

"in_123490aa"

Response

Ok

id
string
required

ID for the agreement invoice

Example:

"1234-5678-9012"

invoiceId
string
required

Invoice ID

elements
object
required

List Agreement invoice elements

agreementId
string
required

Agreement ID

amount
string
required

Amount to be transferred in string format: either cents or token based.

Example:

"1212"

token
string
required

Token address to be transferred

usd
boolean
required

Transfer amount is USD or not

Example:

true

status
number
required

Status of the transfer. Scheduled = 1 Paid = 2 Failed = 3 Cancelled = 4 Uncollectible = 5 Pending = 6 Draft = 7

Example:

3

networkId
number
required

ID of the blockchain network

Example:

1

source
number
required

Source of invoice/data for the transfer Manual = 1 AutoGenerated = 2 Stripe = 3 Chargebee = 4 QuickBooks = 5 Xero = 6

Example:

3

tags
string[] | null
required

A list of tags associated with the transfer

Example:
["Salaries", "Marketing"]
notes
string | null
required

Internal notes saved on the transfer

Example:

"This is July's payment"

entityId
string
required

ID for the entity receiving the transfer

Example:

"1234-5678-9012"

toAddress
string
required

Receiving wallet for the transfer

Example:

"1234-5678-9012"

fromAddress
string
required

Sending wallet for the transfer

Example:

"1234-5678-9012"

billDate
number
required

Date the transfer is due and will process. In seconds

Example:

"1701974672"

billDateTime
string
required

String version of the bill date

Example:

"Mon Oct 16 2023 21:41:59 GMT+0000 (Coordinated Universal Time)"

paidDate
number | null
required

Date the was paid. In seconds

Example:

"1701974672"

paidDateTime
string | null
required

String version of the paid date

Example:

"Mon Oct 16 2023 21:41:59 GMT+0000 (Coordinated Universal Time)"

createdDate
number
required

The date the transfer was created formatted as a Unix timestamp in seconds

Example:

"1664096943"

decodedSignature
object | null
required

The decoded signature of the transfer

attemptCount
number
required

The count of attempts to pay invoice

firstAttemptDate
number | null
required

The first date payment attempted for the invoice

lastAttemptDate
number | null
required

The latest date payment was attempted for the invoice

transactionHash
string | null
required

Transaction hash of the transfer sent to the contract for this invoice.

I