Update a Transfer
Overview
Update the metadata tags on an existing Transfer. Use this to add custom tracking information after a transfer is created.
Resource Access
- User Permissions: Admin users only
- Endpoint:
PUT /transfers/\{transfer_id}
Arguments
| Parameter | Type | Required | Description |
|---|---|---|---|
| transfer_id | string | Yes | Unique Transfer ID (in URL path) |
| tags | object | Yes | Custom key-value metadata to update |
Example Request
curl -X PUT \
'https://api.ahrvo.network/payments/na/transfers/TRtransfer789' \
-u username:password \
-H 'Content-Type: application/json' \
-d '{
"tags": {
"order_id": "ORD-2023-12345",
"product": "subscription",
"customer_tier": "premium",
"fulfillment_status": "shipped",
"tracking_number": "1Z999AA10123456784"
}
}'
Example Response
{
"id": "TRtransfer789",
"created_at": "2023-12-10T20:00:00Z",
"updated_at": "2023-12-11T10:30:00Z",
"amount": 10000,
"currency": "USD",
"state": "SUCCEEDED",
"type": "DEBIT",
"merchant": "MUmerchant123",
"source": "PIcreditCard456",
"destination": null,
"fee": 320,
"ready_to_settle_at": "2023-12-10T20:00:15Z",
"trace_id": "TRC_98765432",
"tags": {
"order_id": "ORD-2023-12345",
"product": "subscription",
"customer_tier": "premium",
"fulfillment_status": "shipped",
"tracking_number": "1Z999AA10123456784"
},
"_links": {
"self": {
"href": "https://api.ahrvo.network/payments/na/transfers/TRtransfer789"
},
"merchant": {
"href": "https://api.ahrvo.network/payments/na/merchants/MUmerchant123"
},
"payment_instrument": {
"href": "https://api.ahrvo.network/payments/na/payment_instruments/PIcreditCard456"
}
}
}
Additional Information
- Tags Only: Cannot change amount, state, or other fields
- Only
tagsfield is mutable - All other fields are immutable after creation
- Amount, merchant, payment instrument locked
- Use reversals to refund, not updates
- Only
- Complete Replacement: Tags are replaced, not merged
- New tags object REPLACES old tags
- Existing tags not in request are DELETED
- Always send complete tags object
- Example: Old tags
{a: 1, b: 2}, Update with{c: 3}→ Result:{c: 3}
- Tag Limits:
- Keys: Alphanumeric, underscore, hyphen
- Values: Strings only
- Max key length: 100 characters
- Max value length: 500 characters
- Max tags per transfer: 50
- Updated At: Timestamp changes
updated_atreflects last modification- Original
created_atunchanged - Use to track when tags were added
- Use Cases:
- Add fulfillment status after shipping
- Link to external systems after processing
- Tag with customer support ticket
- Mark for accounting/reporting
- Add campaign attribution retroactively
- Idempotency: Safe to retry
- Same tags = same result
- No side effects
- Can update multiple times
- Search: Tags are searchable
- Use GET /transfers with tag filters
- Find transfers by custom criteria
- Group by campaign, product, etc.
- No Validation: System doesn't validate tag content
- Any string values accepted
- No schema enforcement
- Your responsibility to maintain consistency
- Consider documenting tag conventions
Use Cases
Add Tracking After Shipment
# Order shipped, add tracking number
curl -X PUT \
'https://api.ahrvo.network/payments/na/transfers/TRtransfer789' \
-u username:password \
-H 'Content-Type: application/json' \
-d '{
"tags": {
"order_id": "ORD-2023-12345",
"product": "widget",
"fulfillment_status": "shipped",
"tracking_number": "1Z999AA10123456784",
"carrier": "UPS",
"shipped_at": "2023-12-11T10:00:00Z"
}
}'
Link to Support Ticket
# Customer opens support ticket about payment
curl -X PUT \
'https://api.ahrvo.network/payments/na/transfers/TRtransfer790' \
-u username:password \
-H 'Content-Type: application/json' \
-d '{
"tags": {
"order_id": "ORD-2023-12346",
"support_ticket": "TICKET-5678",
"issue": "customer_inquiry",
"assigned_to": "agent_jane"
}
}'
Add Campaign Attribution
# Retroactively tag with marketing campaign
curl -X PUT \
'https://api.ahrvo.network/payments/na/transfers/TRtransfer791' \
-u username:password \
-H 'Content-Type: application/json' \
-d '{
"tags": {
"order_id": "ORD-2023-12347",
"campaign": "holiday_2023",
"channel": "email",
"utm_source": "newsletter",
"utm_medium": "email",
"utm_campaign": "holiday_sale"
}
}'
Mark for Accounting Review
# Flag high-value transaction for review
curl -X PUT \
'https://api.ahrvo.network/payments/na/transfers/TRtransfer792' \
-u username:password \
-H 'Content-Type: application/json' \
-d '{
"tags": {
"order_id": "ORD-2023-12348",
"product": "enterprise_license",
"accounting_status": "pending_review",
"reviewer": "accounting_dept",
"amount_category": "high_value",
"review_required": "true"
}
}'
Best Practices
- Include Existing Tags: Always send complete tags
// WRONG: Will delete existing tags
await updateTransfer(id, {
tags: { tracking_number: '123' }
});
// RIGHT: Include existing tags
const transfer = await fetchTransfer(id);
await updateTransfer(id, {
tags: {
...transfer.tags,
tracking_number: '123'
}
}); - Tag Naming Conventions: Use consistent naming
- snake_case for keys
- Descriptive names
- Avoid abbreviations
- Document schema
- Example:
fulfillment_statusnotstatus
- Timestamp Tags: Use ISO 8601
shipped_at: "2023-12-11T10:00:00Z"- Easier to parse and filter
- Includes timezone
- Sortable
- Boolean Tags: Use strings
"true"or"false"nottrueorfalse- Tags are string-only
- Consistent casing
- Consider
"yes"/"no"or"1"/"0"
- Error Handling: Check response
- Verify tags updated
- Check
updated_atchanged - Validate critical tags
- Retry on network errors
- Audit Trail: Track tag changes
- Log who updated and when
- Store old values
- Use for compliance
- Helpful for debugging
- Performance: Update sparingly
- Not intended for frequent updates
- Consider batching changes
- Use webhooks instead of polling + updating
Common Workflows
Fulfillment Integration
- Payment succeeds
- Create order in fulfillment system
- Fulfillment system ships order
- Webhook from fulfillment system
- Update transfer with tracking info
- Send tracking email to customer
Customer Support Flow
- Customer contacts support about payment
- Support agent looks up transfer by order ID
- Agent adds support ticket to tags
- Agent resolves issue
- Update tags with resolution
- Use for reporting and training
Marketing Attribution
- Payment created without UTM tags
- Later, link payment to marketing campaign
- Update transfer with campaign tags
- Run reports on campaign performance
- Calculate ROI by campaign
Accounting Workflow
- End of day: List all transfers
- For high-value transfers:
- Update with accounting_status tag
- Accountant reviews flagged transfers
- Update with approval status
- Export to accounting system
Related Endpoints
- POST /transfers: Create a transfer
- GET /transfers: List transfers (filter by tags)
- GET /transfers/{id}: Fetch transfer details
- POST /transfers/{id}/reversals: Create refund
- GET /transfers/{id}/reversals: List refunds