Scenario simulation
This page describes how to simulate postpaid card tracking status updates to test delivery update flows. These simulations are useful for homologation and integration testing.
Information
These requests simulate tracking status updates and return the HTTP status with updated tracking data.
1 - Tracking status update simulation
Simulates the tracking status update of a postpaid card, allowing transitions between different states of the delivery process. The update creates a new event in the tracking history.
ENDPOINT
/mock/wallet/WALLET_KEY/card/CARD_KEY/trackingMETHOD
PATCHPath Parameters
| Field | Type | Description | Characters |
|---|---|---|---|
wallet_key * | string | Unique wallet key in UUID v4 format | 36 |
card_key * | string | Unique card key in UUID v4 format | 36 |
Request Body
{
"status": "posted",
"place": "São Paulo - SP",
"description": "Postado - logística iniciada",
"reason": "Processamento concluído"
}
Request Body Object
| Field | Type | Description | Max. Chars. |
|---|---|---|---|
status * | string | New tracking status | Status enumerators |
place * | string | Location where the event occurred | 100 |
description * | string | Tracking event description | 255 |
reason | string | Additional reason for the event (optional) | 100 |
Status enumerators
| Enumerator | Description |
|---|---|
pending | Pending - awaiting initial processing |
posted | Posted - logistics initiated |
prepared | Prepared - card prepared for transfer |
in_transfer | In transfer - card in transit |
in_delivery_unit | At delivery unit - card arrived at distribution unit |
on_route | On route - card out for delivery |
attempt_failed | Attempt failed - delivery attempt was not successful |
awaiting_withdrawal | Awaiting withdrawal - card available for pickup |
returning | Returning - card in return process |
delivered | Delivered - card was successfully delivered |
returned | Returned - card was returned |
canceled | Canceled - tracking was canceled |
failed | Failed - delivery process failure |
resend | Resend - card will be resent |
redispatch_error | Redispatch error - error when redispatching the card |
waiting_for_address_update | Waiting for address update - awaiting address confirmation |
Response
STATUS
204Response Body
{}
Behavior
- The simulation updates the tracking status and creates a new event in the history
- Status transitions follow a specific order and validations are applied:
- Cannot go back to previous statuses (except special statuses)
- Cannot change status from final statuses (
delivered,returned,canceled,failed) - Cannot transition from
waiting_for_address_updateto any status other thanpending - Cannot transition to
waiting_for_address_updatefrom final statuses - Special statuses (
attempt_failed,resend,redispatch_error) can be used at any time after the initial status
- The
reasonfield is optional and, when provided, is concatenated to the event description