Collections
Update a Collection

Update a collection

Amends a collection that has not yet been paid. Send only the fields you want to change.

PUT
https://api-prod.useknit.io/api/v1/collections/{id}
Scopecollections:writeAuthBearer token
⚠️

Updating does not extend the 30-minute expiry and does not issue a new address. Once a payment has been detected, create a new collection instead of amending this one.

Path parameters

idstringrequired

The collection's id.

Body

Every field is optional; omitted fields are left unchanged.

networkstringoptional

A network that is active for collections.

tokenstringoptional

A token that is active for collections on that network.

tokenAmountnumberoptional

Must be greater than zero.

confirmationThresholdintegeroptional

Must be greater than zero.

merchantCallbackUrlstringoptional

Must be a publicly reachable http:// or https:// URL.

merchantRedirectUrlstringoptional

Must be a valid http:// or https:// URL, or null to clear it.

Request

cURL
curl -X PUT "https://api-prod.useknit.io/api/v1/collections/9cddd3ad-c2a8-463c-a703-158b900beea8" \
  -H "Authorization: Bearer $KNIT_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tokenAmount": 3000,
    "merchantRedirectUrl": "https://example.com/checkout/complete"
  }'

Response

200 OK
{
  "statusCode": 200,
  "message": "Collection updated successfully",
  "data": {
    "id": "9cddd3ad-c2a8-463c-a703-158b900beea8",
    "network": "MATIC_MAINNET",
    "token": "USDT",
    "tokenAmount": "3000.000000000000000000",
    "status": "PENDING",
    "merchantRedirectUrl": "https://example.com/checkout/complete",
    "updatedAt": "2024-08-27T13:41:02.000000Z"
  },
  "success": true
}

Errors

StatusCause
401Missing or invalid token, IP not allow-listed, or missing collections:write
404No collection with that ID belongs to your business
400A supplied field failed validation