v1

latestOpenAPI 3.1.02026-07-24170121.2 MB

Update Charge Metadata

This API updates the metadata associated with an existing charge. Use it to attach or modify internal reference information against a charge.

patch/v1/charges/{charge_id}

Path parameters

charge_idstring required

charge_id here represents the specific charge whose metadata should be updated.

Request body

metadatastring

A JSON object of key/value pairs to store against the charge, e.g. {"order_number":"PO-12345"}. Provided keys are added or overwritten; existing keys not included in the payload are left unchanged. Sending a key with an empty string value ("") deletes that key. Keys must be non-empty and at most 20 characters; values must be strings of at most 1000 characters. A maximum of 50 keys can be sent per request.

Example request

{
  "metadata": "{\"order_number\":\"PO-12345\"}"
}

Response

200

Example response

{
  "data": {
    "object": "Charge",
    "id": "DLbnOBbBDWMbbOoM",
    "amount": 99,
    "amount_approved": 99,
    "amount_captured": 500,
    "tip_amount": 20,
    "type": "Sale",
    "customer_email": "eric.yulfo@payarc.com",
    "captured": 1,
    "status": "submitted_for_settlement",
    "auth_code": "TAS697",
    "statement_description": "Eric's Energy Drinks",
    "created_at": 1725459426,
    "updated_at": 1725461016,
    "card_level": "LEVEL1",
    "created_by": "serviceuser0567051053675152@payarc.com",
    "transaction_metadata": {
      "data": [
        {
          "object": "TransactionMeta",
          "id": "aWxMnbBDWMbbOoQ",
          "key": "order_number",
          "value": "PO-12345"
        }
      ]
    },
    "tsys_response_code": "A0000",
    "host_response_code": "00",
    "host_response_message": "Success",
    "host_reference_number": "424814500418",
    "card": {
      "data": {
        "object": "Card",
        "id": "vmy905NNNm5y0M2L",
        "card_source": "PHONE",
        "is_default": 1,
        "exp_month": "12",
        "exp_year": "2025",
        "is_verified": 1,
        "fingerprint": "my905PmvmPNmNP0M",
        "brand": "V",
        "last4digit": "5439",
        "first6digit": 401200,
        "avs_status": "0",
        "cvc_status": "M",
        "customer_id": "4DPNMVjxNPnMVnjA",
        "created_at": 1725451100,
        "updated_at": 1725451161
      }
    }
  },
  "meta": {
    "include": [
      "review"
    ]
  }
}