v1

latestOpenAPI 3.1.02026-07-222392081.7 MB
Customers > Credits

Update credit topup expiration

Update the expiration date of a topup credit transaction. Only non-expired topup transactions can be updated.

patch/v1/customers/{id}/credits/{productId}/transactions/{transactionId}

Path parameters

idstring required
productIdstring required
transactionIdstring required

Request body

expires_atstring date-time nullable required

Expiration date for credits linked to this transaction. UTC date time string in the ISO 8601 format.

Example request

{
  "expires_at": "2024-12-20T16:04:11Z"
}

Response

The updated credit transaction

idstring required

Credit transaction ID.

product_idstring nullable required

ID of the product related to the transaction.

customer_idstring required

ID of the customer related to the transaction.

payment_method_idstring nullable required

ID of the payment method related to the transaction.

invoice_idstring nullable required

ID of the invoice related to the transaction.

event_idstring nullable required

ID of the event related to the credit consumption.

aggregator_idstring nullable required

ID of the aggregator that triggered this usage (for multi-aggregator credits).

expires_atstring date nullable required

Expiration date for credits linked to this transaction

type'topup' | 'usage' | 'expiration' required

Type of credit transaction.

source'app' | 'portal' | 'api' | 'system' required

Deprecated field, we recommend no longer using it.

amount_excluding_taxnumber nullable required

Monetary amount. Expressed in currency's smallest unit.

credit_countnumber required

Value of credits related to the transaction.

balance_afternumber required

Credit balance after the transaction.

created_atstring date-time required

Credit transaction creation date. UTC date time string in the ISO 8601 format.

updated_atstring date-time required

Credit transaction last edition date. UTC date time string in the ISO 8601 format.

Example response

{
  "id": "cdt_BPZ19obsBS2qyo",
  "product_id": "itm_3kXODDF42QXtnL",
  "price": {
    "id": "pri_0Jv8EbMDOGsHcn",
    "amount": 20000,
    "pack_size": 120
  },
  "customer_id": "cus_Typ0px2W0aiEtl",
  "payment_method_id": "pm_1xMpj5bwRqN7LM",
  "invoice_id": "inv_1eTaiytfA0i2Va",
  "type": "topup",
  "source": "system",
  "credit_count": 32,
  "balance_after": 2000,
  "created_at": "2024-10-13T07:00:01.860Z",
  "updated_at": "2024-10-13T07:00:01.860Z"
}