Skip to main content

Scenario Simulation - Invoice Closing and Expiration

This page describes how to simulate invoice closing and expiration to test the transaction flow with post-paid cards. These simulations are useful for approval and integration testing.

1 - Invoice closing simulation

Simulates the closing of an open invoice, changing its status to processing_closing and publishing the message in the closing queue. The invoice will be processed according to the wallet configuration.

ENDPOINT
/mock/invoice/INVOICE_KEY/close
MÉTODO
PATCH

Path Parameters

FieldTypeDescriptionCharacters
invoice_key *stringUnique invoice key in UUID v4 format36

Headers

Request Body

This request has no body.

Response

STATUS
204
Response Body

{}

Response Body Params

This response has no parameters in the body.

Behavior
  • The simulation changes the invoice status to processing_closing
  • The invoice must have status opened to be able to be closed
  • A status change notification is sent to the client

2 - Invoice expiration simulation

Simulates the expiration of a closed invoice, changing its status to processing_expiration and publishing the message in the expiration queue. The invoice will be processed according to the wallet configuration.

ENDPOINT
/mock/invoice/INVOICE_KEY/expire
MÉTODO
PATCH

Path Parameters

FieldTypeDescriptionCharacters
invoice_key *stringUnique invoice key in UUID v4 format36

Request Body

This request has no body.

Response

STATUS
204
Response Body

{}

Response Body Params

This response has no parameters in the body.

Behavior
  • The simulation changes the invoice status to processing_expiration
  • The invoice cannot have status opened (it must be closed)
  • The wallet must have at least one open invoice
  • The wallet's next closing date cannot be earlier than the next due date
  • A status change notification is sent to the client