Skip to main content

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/tracking
METHOD
PATCH

Path Parameters

FieldTypeDescriptionCharacters
wallet_key *stringUnique wallet key in UUID v4 format36
card_key *stringUnique card key in UUID v4 format36
Request Body
{
"status": "posted",
"place": "São Paulo - SP",
"description": "Postado - logística iniciada",
"reason": "Processamento concluído"
}

Request Body Object

FieldTypeDescriptionMax. Chars.
status *stringNew tracking statusStatus enumerators
place *stringLocation where the event occurred100
description *stringTracking event description255
reasonstringAdditional reason for the event (optional)100

Status enumerators

EnumeratorDescription
pendingPending - awaiting initial processing
postedPosted - logistics initiated
preparedPrepared - card prepared for transfer
in_transferIn transfer - card in transit
in_delivery_unitAt delivery unit - card arrived at distribution unit
on_routeOn route - card out for delivery
attempt_failedAttempt failed - delivery attempt was not successful
awaiting_withdrawalAwaiting withdrawal - card available for pickup
returningReturning - card in return process
deliveredDelivered - card was successfully delivered
returnedReturned - card was returned
canceledCanceled - tracking was canceled
failedFailed - delivery process failure
resendResend - card will be resent
redispatch_errorRedispatch error - error when redispatching the card
waiting_for_address_updateWaiting for address update - awaiting address confirmation

Response

STATUS
204
Response 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_update to any status other than pending
    • Cannot transition to waiting_for_address_update from final statuses
    • Special statuses (attempt_failed, resend, redispatch_error) can be used at any time after the initial status
  • The reason field is optional and, when provided, is concatenated to the event description