Skip to main content
POST
/
api
/
v1
/
agreement
/
disconnect
Disconnect agreement from Stripe
curl --request POST \
  --url https://demo.api.loopcrypto.xyz/api/v1/agreement/disconnect \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --header 'entity-id: <api-key>' \
  --data '{
  "agreementId": 10,
  "externalSubscriptionId": "sub_12345"
}'
{
  "agreements": [
    {
      "agreementId": "83aac889-da5b-4432-ac51-b05cf3ae2aac",
      "walletAddress": "0x56be8cpbed39582aad0eaa6e8f2adb109152fb6c",
      "networkId": 137,
      "email": "testing@example.xyz",
      "entityId": "911492f7-688d-11ed-9618-06613fde562",
      "token": "0x07865c6E87B9F70255377e024ace6630C1Eaa37F",
      "itemId": "8199041b-a8c2-40ae-b90d-633d3eb59111",
      "startDate": 1672423318,
      "status": 2,
      "cancelledAt": 1672761102,
      "cancellationEffectiveDate": 1672761534,
      "cancellationReason": "Cancelled by entity",
      "refId": "user-42",
      "discountPercent": 42,
      "externalId": "sub_1ObTC0EsKlmFX3FHDjZnmim1",
      "externalReferenceId": "mySpecialReference",
      "cancellationSource": 3,
      "allowCancel": true,
      "allowResubscribe": true,
      "paymentMethod": {
        "paymentMethodId": "1234567890abcdef",
        "merchantId": "67e55044-10b1-426f-9247-bb680e5fe0c8",
        "paymentMethodName": "My Crypto Wallet",
        "active": true,
        "customer": {
          "customerId": "1234567890abcdef",
          "customerRefId": "1234567890abcdef"
        },
        "networkId": 1,
        "walletAddress": "0x1234567890abcdef",
        "isDefault": true,
        "token": {
          "symbol": "USDC",
          "tokenId": "123e4567-e89b-12d3-a456-426614174000",
          "address": "0x1234567890abcdef",
          "decimals": 6,
          "exchangeRates": [
            {
              "currency": "USD",
              "price": "10000",
              "provider": "CoinMarketCap",
              "timestamp": 1715731200
            }
          ]
        },
        "preAuthorization": {
          "balance": "100",
          "authorization": "49.9"
        },
        "dateCreated": 1716211200
      }
    }
  ]
}

Authorizations

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

Body

application/json
agreementId
string
required

Loop ID of the agreement to disconnect

Example:

10

externalSubscriptionId
string
required

External subscription ID

Example:

"sub_12345"

Response

Ok

To get agreementIDs, you can use the “get agreements” endpoint to query all the wallets that have authorized your contract and their associated items.

agreements
object[]
required

A list of the returned agreements based on the request

I