# Update payment `PATCH` `/payments/{id}` Updates an existing payment by ID ## Parameters - **id** (`string`, required) — Payment ID previously sent or generated at creation. ## Request body - **payment** (`object`, required) - **status** (`string enum`, required) — Final payment status. See the [documentation for more details on possible statuses](https://docs.glassdata.io/en/transactional/payment_modeling/status/). - Allowed: `succeeded`, `declined`, `failed`, `blocked` - **method** (`object`) — Payment method. Use this parameter only when it is necessary to supplement data that could not be transmitted at creation. - **type** (`string`) — Payment method type. - **card** (`object`) - **network** (`string enum`, required) — Card network - Allowed: `visa`, `mastercard`, `american_express`, `diners_club`, `elo`, `hipercard`, `jcb`, `discover`, `other` - **presence** (`string enum`, required) — Indicates whether the transaction was made with card present (CP) or card not present (CNP). See the [card presence documentation](https://docs.glassdata.io/en/api/methods/post_payments/) for more information. - Allowed: `card_present`, `card_not_present` - **bin** (`string | null`) — First 8 digits of the PAN that identify the card issuer (also known as IIN) - **last_four** (`string | null`) — Last 4 digits of the PAN - **transactions** (`array`) — List of transaction attempts for this payment. Required if payment `status` is `succeeded` or `declined`. Recommended for `failed` and `blocked` if there are transaction attempts. - **id** (`string`) — Unique transaction identifier code. See the [documentation for more details on the transaction code](https://docs.glassdata.io/en/transactional/payment_modeling/identifiers/). - **status** (`string enum`, required) — Transaction attempt return status. See the [documentation for more details on possible statuses](https://docs.glassdata.io/en/transactional/payment_modeling/status/). - Allowed: `succeeded`, `declined`, `failed`, `canceled` - **duration** (`integer`) — Transaction execution time in milliseconds (1 second = 1000 milliseconds). - **timestamp** (`date-time | null`) — Date and time when the transaction was initiated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If not sent, the current time will be used. The maximum period for retroactive submission (backfill) is 24 hours. Future timestamps are not allowed. - **connector** (`object`, required) — Information about the payment connector used in the transaction. The connector can be an acquirer, a sub-acquirer, or a gateway. - **id** (`string`, required) — Integration code with the connector. Provide a code that represents an affiliation contract or a specific integration connection. We recommend prefixing the code with the connector type to facilitate report queries. - **type** (`string`) — Connector type (e.g., acquirer, sub-acquirer, or gateway). Optional free-text field; we recommend a standardized value to facilitate report queries. - **response_code** (`string | null`) — Alphanumeric response code of the attempt. For credit cards in Brazil, preferably use the standard determined by [ABECS normative 21](https://api.abecs.org.br/wp-content/uploads/2019/09/Normativo-021.pdf). Required if `transaction.status` is `succeeded` or `declined`. Recommended for `failed` and `canceled` when present. ```json { "payment": { "status": "succeeded", "method": { "type": "string", "card": { "network": "visa", "presence": "card_present", "bin": "40000000", "last_four": "1234" } }, "transactions": [ { "id": "string", "status": "succeeded", "duration": 0, "timestamp": "2024-01-01T00:00:00Z", "connector": { "id": "cielo-39123747819782", "type": "cielo", "response_code": "00" } } ] } } ``` ## Responses ### 200 — Payment updated successfully ### 401 — Invalid access credentials - **errors** (`array`) - **field** (`string`) — Request field where the error occurred - **type** (`string`) — Error type code - **message** (`string`) — Error message ```json { "errors": [ { "field": "string", "type": "string", "message": "string" } ] } ``` ### 422 — Invalid parameters - **errors** (`array`) - **field** (`string`) — Request field where the error occurred - **type** (`string`) — Error type code - **message** (`string`) — Error message ```json { "errors": [ { "field": "string", "type": "string", "message": "string" } ] } ``` ### 404 — Object not found - **errors** (`array`) - **field** (`string`) — Request field where the error occurred - **type** (`string`) — Error type code - **message** (`string`) — Error message ```json { "errors": [ { "field": "string", "type": "string", "message": "string" } ] } ```