Update Transaction

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

📘

Negative values for transaction values such as amount, discount are not considered.

Note: Extended field updates are supported for REGULAR, RETURN, NOT_INTERESTED, and NOT_INTERESTED_RETURN transaction types. MIXED transactions are not supported.

Example request

curl --location --request PUT 'https://eu.api.capillarytech.com/v2/transactions?identifierName=mobile&identifierValue=919986000586' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmVlc3RvcmV0aWxsc3NzoyMDJjYjk2MmFjNTkwNzViOTY0YjA3MTUyZDIzNGI3MA==' \
--header 'Cookie: _cfuvid=nqxTNRsWRIahnyM3eUc36V7PaRf1iZMfFubj3vNvPJA-1721630804772-0.0.1.1-604800000' \
--data '{
  "id": 873547608,
  
  "extendedFields": {
    "ship_first_name": "Test1updatedagain",
    "ship_last_name": "Singh",
    "checkin_date":"2010-06-04 21:08:12",
    "checkout_date":"2010-06-05 21:08:12"
  },
  "customFields": {
    "ordersource": "testnee123updatedagain"
  }
,

  "lineItems":[{
    
    "itemCode":"sku_234_2",
    "extendedFields":
    {
        "MetalRate": "10577",
        "GrossWeight": "10.50"
      }
  }]


}'

Prerequisites

  • The caller must have valid API credentials with write access to transactions.
  • Extended fields and custom fields used in the request must be configured for the organisation.

Header information

Header nameDescription
SKIP-DOWNSTREAMIf set to true, the API request updates the customer transaction record directly without notifying downstream systems such as the Loyalty Engine (EMF) or event notification services, and no side effects will be generated. This allows the API to behave like a data import, where no loyalty actions or event triggers are executed.

Query parameters

FieldTypeRequiredDescription
identifierNameenumConditionalRegistered identifier name of the customer. Values: mobile, email, externalId, id, wechat, martjackid, fbId, cardnumber, cardExternalId. Not required for NOT_INTERESTED and NOT_INTERESTED_RETURN transaction types.
identifierValuestringConditionalValue for the chosen identifier (e.g. mobile number if identifierName is mobile). Not required for NOT_INTERESTED and NOT_INTERESTED_RETURN transaction types.
sourceenumOptionalSource from which the transaction was made. Values: INSTORE, WECHAT, MARTJACK, WEB_ENGAGE, ECOMMERCE, JD, TAOBAO, TMALL, FACEBOOK, WEBSITE, OTHERS.
accountIdstringOptionalAccount ID for sources with multiple accounts (e.g. MARTJACK, WECHAT). Not applicable for INSTORE.

Body parameters

Note: The Updatable column indicates whether a field can be changed after the transaction is recorded. Fields marked No are used to identify the transaction and cannot be modified.

FieldTypeRequiredDescriptionUpdatable
idlongConditionalUnique transaction ID generated internally. Required if number is not provided.No
numberstringConditionalUnique transaction number. Required if id is not provided. If a bill number matches multiple transactions, use id instead to identify the transaction uniquely.No
typeenumOptionalTransaction type hint for lookup scoping. Values: REGULAR, RETURN, NOT_INTERESTED, NOT_INTERESTED_RETURN. Defaults to REGULAR if omitted.No
extendedFieldsobjOptionalTransaction-level extended fields as name-value pairs. Supported for REGULAR, RETURN, NOT_INTERESTED, and NOT_INTERESTED_RETURN types.Extended fields cannot be updated for MIXED transactions.Yes
customFieldsobjOptionalTransaction-level custom field details as name-value pairs. Supported for REGULAR, RETURN, NOT_INTERESTED, and NOT_INTERESTED_RETURN types. Not supported for MIXED transactions.Yes
deliveryStatusenumOptionalDelivery status of the transaction. Values: PLACED, PROCESSED, SHIPPED, DELIVERED, RETURNED.Yes
lineItemsarrayOptionalArray of line item objects to update. Either itemCode or line item id is required to identify each line item.Yes
lineItems.itemCodestringConditionalItem code of the line item. Required if line item id is not provided.No
lineItems.idintConditionalLine item ID generated during transaction creation. Required if itemCode is not provided.No
lineItems.extendedFieldsobjOptionalLine item-level extended field details as name-value pairs.Yes
lineItems.outlierStatusenumOptionalOutlier status for the line item. Supported for REGULAR and NOT_INTERESTED types only. Not supported for RETURN and NOT_INTERESTED_RETURN.Yes

Example response

{
  "id": 873547608,
  
  "extendedFields": {
    "ship_first_name": "Test1updatedagain",
    "ship_last_name": "Singh",
    "checkin_date":"2010-06-04 21:08:12",
    "checkout_date":"2010-06-05 21:08:12"
  },
  "customFields": {
    "ordersource": "testnee123updatedagain"
  }
,

  "lineItems":[{
    
    "itemCode":"sku_234_2",
    "extendedFields":
    {
        "MetalRate": "10577",
        "GrossWeight": "10.50"
      }
  }]


}

Response parameters

ParameterDatatypeDescription
extended_fieldsobjExtended field details of the transaction that are updated.
custom_fieldsobjCustom field details of the transaction that are updated.
idlongUnique ID of the transaction generated by the system.
numberstringBill or transaction number.
typeenumCurrent transaction type.
customerobjCustomer details associated with the transaction.

Error & warning codes

CodeError numberTypeDescription
ERR_TRANSACTION_ID_NUMBER_INVALID667ErrorTransaction ID not found for this customer. HTTP 400.
ERR_DUPLICATE_BILL_NUMBER_USE_ID668ErrorBill number matches multiple transactions. Pass the transaction id instead of number to identify the transaction uniquely. HTTP 400.
669ErrorUnable to update the custom field. HTTP 400.
📘

Note

Custom fields can only be added if they meet the following conditions:

  • The field must exist in the custom_fields table for the particular organization.
  • It must belong to the same org_id as the current use-case.
  • The field’s scope must be set to LOYALTY_REGISTRATION.
📘

Note

Extended fields that you use must match with the extended fields defined in the respective organization.


Query Params
string
enum
string
string
enum
string
Body Params
int64
string
string
enum
Allowed:
Headers
boolean
Responses

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json