API Docs
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

ParameterTypeDescription
payment_idstringRequired. The ID of the payment to update.

Body Parameters

ParameterTypeRequiredDescription
amountintegerNoThe updated amount for the payment.
currencystringNoThe three-letter ISO 4217 currency code.
descriptionstringNoAn arbitrary string attached to the payment.
metadataobjectNoSet of key-value pairs for storing additional information.
customer_idstringNoThe 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": {}
}