Payments
API ReferencePaymentsUpdate
Update Payment
Update the properties of an existing payment resource.
POST /payments/:payment_id
Updates a Payment resource. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
payment_id | string | Required. The ID of the payment to update. |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | integer | No | The updated amount for the payment. |
currency | string | No | The three-letter ISO 4217 currency code. |
description | string | No | An arbitrary string attached to the payment. |
metadata | object | No | Set of key-value pairs for storing additional information. |
customer_id | string | No | The identifier for the customer. |
Request Example
curl -X POST 'https://api.v2.paychtec.com/payments/pay_mbabizu24mvu3mela5njyhpit4' \ -H "Content-Type: application/json" \ -H "api-key: snd_YOUR_API_KEY" \ -d '{ "amount": 7654, "description": "Updated payment description"}'Response
{
"payment_id": "pay_mbabizu24mvu3mela5njyhpit4",
"status": "requires_confirmation",
"amount": 7654,
"currency": "USD",
"client_secret": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
"created": "2024-01-22T10:11:12Z",
"modified_at": "2024-01-22T10:15:00Z",
"customer_id": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"description": "Updated payment description",
"metadata": {}
}