Add Request

Add a transaction or customer merge request

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

The API lets you create a transaction or a customer merge request.

Customer Merge Request

You can make customer merge requests in standard organizations, organizations with dual eligibility enabled, and connected organizations.

Customer merge requests are defaulted to Pending. Capillary’s backend team reviews the request and either approves or rejects it. However, you can use the client_auto_approve=true query parameter in the API to automatically process the request.

In a connected organization setup, the ability to create customer merge requests depends on where the request originates. Only parent organizations can initiate merge requests. All POST requests to the /v2/requests endpoint from child organizations are blocked. Survivor and victim customers must be registered in the parent organization and all child organizations.

Conditions for Adding Merge Requests in Connected Organizations

Customer merge requests are added to the parent and child organizations based on the presence of both the victim and survivor customers. Use the following rules to determine when to add or ignore the request:

Customer Exists in Organization Victim Available Survivor Available Action

Parent

Yes

Yes

Add the request

Child

No

Yes

Ignore the request
You can't merge if only the survivor exists.

Child

Yes

No

Ignore the request
You can't merge if only the victim exists.

Child

No

No

Ignore the request
Neither of the customers exists.

Child

Yes

Yes

Multiplex and merge the customers
Note: Multiplexing refers to automatically replicating a merge request from the parent organization to all eligible child organizations.

Note: In a setup with one parent and two or more child organizations, the merge request will not be multiplexed to that organisation if either the survivor or the victim customer is absent from any organization.

Prerequisites

  • Authentication - Basic or OAuth authentication
  • Access group resource - Write permission on the Requests resource group.

Resource Information

URLv2/requests
HTTP methodPOST
PaginationNA
Batch supportNA

Example request

curl --location 'https://eu.api.capillarytech.com/v2/requests' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGjE5' \
--header 'Cookie: _cfuvid=G6oxIkgK2fZsiAlvp1Hq7JkcB.t_CLzqxY.NmLbxwXQ-1771394758003-0.0.1.1-604800000' \
--data '{
    "type": "TRANSACTION",
    "baseType": "REGULAR_TXN_ADD",
    "customerIdentificationInfo": {
        "identifierType": "mobile",
        "identifierValue": "919999988886",
        "source": "INSTORE"
    },
    "transaction": {
        "type": "REGULAR",
        "billingDate" : "2025-04-29T10:00:00+05:30",
        "billNumber": "test00transact088",
        "discount": "0",
        "billAmount": "6000",
        "note": "Add Transaction Request 88",
        "grossAmount": "6000",
        "deliveryStatus": "PLACED",
        "paymentModes": [
            {
                "notes": "",
                "mode": "Cash",
                "value": "6000"
            }
        ],
        "lineItemsV2": [
            {
                "itemCode": "model_id_001",
                "description": "sports shoes",
                "amount": 6000.0,
                "rate": 2000.0,
                "qty": 3,
                "discount":0
            } 
        ]
    }
}'
curl --location 'https://eu.api.capillarytech.com/v2/requests?source=INSTORE&client_auto_approve=true' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bWFkaMjU2YQ==' \
--header 'Cookie: _cfuvid=G6oxIkgK2fZsiAlvp1Hq7JkcB.t_CLzqxY.NmLbxwXQ-1771394758003-0.0.1.1-604800000' \
--data '{
    "type": "TRANSACTION",
    "baseType": "REGULAR_TXN_ADD",
    "customerIdentificationInfo": {
       "identifierType": "mobile",
        "identifierValue": "919999988886",
        "source": "INSTORE"
    },
    "transaction": {
        "type": "REGULAR",
        "billingDate" :"2025-04-29T10:00:00+05:30",
        "billNumber": "test00transact088",
        "discount": "0",
        "billAmount": "6000",
        "note": "Add Transaction Request 88",
        "grossAmount": "6000",
        "deliveryStatus": "PLACED",
        "paymentModes": [
            {
                "notes": "",
                "mode": "Cash",
                "value": "6000"
            }
        ],
        "lineItemsV2": [
            {
                "itemCode": "model_id_001",
                "description": "sports shoes",
                "amount": 6000.0,
                "rate": 2000.0,
                "qty": 3,
                "discount":0
            } 
        ]
    }
}'

Request body parameters for Transaction Request

ParameterMandatoryTypeDescription
typerequiredStringThe type of the transaction, in this case, "TRANSACTION."
baseTyperequiredStringThe base type of the transaction, in this case, "REGULAR_TXN_ADD."
customerIdentificationInforequiredObjectContains customer identification information, including the identifier type (externalId), identifier value, and source (INSTORE).
transactionnot requiredObjectContains details about the transaction, such as type, billing date, bill number, discounts, bill amount, gross amount, delivery status, payment modes, custom fields, and line items.
typenot requiredStringThe type of the transaction, in this case, "REGULAR."
billingDatenot requiredStringThe billing date in ISO 8601 format, e.g., "2022-12-13T11:58:18+05:30."
billNumbernot requiredStringThe bill number associated with the transaction, e.g., "4113641."
discountnot requiredStringThe discount amount, e.g., "0."
billAmountnot requiredStringThe total bill amount, e.g., "21."
notenot requiredStringAdditional notes or comments for the transaction, if any.
grossAmountnot requiredStringThe gross amount of the transaction, e.g., "21."
deliveryStatusnot requiredStringThe delivery status of the transaction, e.g., "SHIPPED."
paymentModesnot requiredArrayAn array of objects containing details about the payment modes used in the transaction.
customFieldsnot requiredObjectContains custom fields related to the transaction, e.g., "paymentmode," "vendor_name," and "added_on."
lineItemsV2not requiredArrayAn array of objects containing details about individual line items in the transaction, including item codes, descriptions, amounts, rates, quantities, and discounts.
imagesnot requiredArrayAn array of objects representing images related to the transaction, including file names, serial numbers, namespaces, and providers.

Response for Transaction Request

ParameterDescription
createdIdTransaction request id
warningsWarnings, if any.

Request Query Parameter for Customer Merge

Parameter (Parameters marked with * are mandatory) Data Type Description

source*

String

Source from which the customer is created. Value: INSTORE. Currently, only INSTORE is supported.

client_auto_approve

Boolean

Automatically approves the merge request. Default value: false
By default, the system creates all requests with a Pending status. When you set client_auto_approve=true, the request is still created as Pending, but the system automatically processes and updates it to Approved without manual review.
Note: Avoid using the client_auto_approve parameter unless necessary.

Request Body Parameters for Customer Merge

Note: One of the fields marked with ** is mandatory.

Parameter(Parameters marked with * are mandatory)Data TypeDescription
victimCustomer*ObjectDetails of the customer to be removed (victim).
-mobile**StringMobile number of the customer to be merged (victim).
-email**StringEmail address of the customer to be merged.
-externalId**StringExternal ID of the customer to be merged.
-accountId **StringAccount ID of the customer to be merged.
-id**StringCustomer ID of the customer to be merged.
baseType*StringBase type of the request. Use "MERGE" for customer merge.
type*StringType of change. Use "CHANGE_IDENTIFIER" for customer merge.
survivorCustomer*ObjectDetails of the customer to retain (survivor).
-mobile**StringMobile number of the customer to retain.
-email**StringEmail address of the customer to retain.
-externalId**StringExternal ID of the customer to retain.
-accountId**StringAccount ID of the customer to retain.
-id**StringCustomer ID of the customer to retain.
curl --location 'https://eu.api.capillarytech.com/v2/requests?source=INSTORE' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic ZGllYTI0YTYyZTZm' \
--header 'Cookie: _cfuvid=EWw7Wfz8Ouj54ZVF2cPldbObmSaOCCsfBD._qxSWZoM-1744468652196-0.0.1.1-604800000' \
--data-raw '{
    "victimCustomer": {
        "mobile": "919865398633",
        "email" : "[email protected]"

    },
    "baseType": "MERGE",
    "type": "CHANGE_IDENTIFIER",
    "survivorCustomer": {
        "mobile": "919865398634",
        "email": "[email protected]"

    }
}'
curl --location 'https://eu.api.capillarytech.com/v2/requests?source=INSTORE' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YXV0b3NTJkMjM0Yjcw' \
--data-raw '{
"victimCustomer": {
    "mobile": "917569065670",
    "email" : "[email protected]",
    "externalId": "externalId7569065670"
},
"baseType": "MERGE",
"type": "CHANGE_IDENTIFIER",
"survivorCustomer": {
    "mobile": "918082558297",
    "email": "[email protected]",
    "externalId": "externalId8082558297"
}
}'
curl --location 'https://eu.api.capillarytech.com/v2/requests?source=INSTORE' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YXVNWI5NjRiMDcxNTJkMjM0Yjcw' \
--data-raw '{
"victimCustomer": {
    "mobile": "917569065670",
    "email" : "[email protected]",
    "externalId": "externalId7569065670"
},
"baseType": "MERGE",
"type": "CHANGE_IDENTIFIER",
"survivorCustomer": {
    "mobile": "918082558297",
    "email": "[email protected]",
    "externalId": "externalId8082558297"
}
}'
curl --location 'https://eu.api.capillarytech.com/v2/requests?source=INSTORE_V2&client_auto_approve=true' \
--header 'Authorization: Basic YNjRiMDcxNTJkMjM0Yjcw' \
--header 'Content-Type: application/json' \
--data '{
"victimCustomer": {
   "id":"387754951"
},
"baseType": "MERGE",
"type": "CHANGE_IDENTIFIER",
"survivorCustomer": {
    "id":"387754954"
}
}'

Response Parameters for Customer Merge

ParameterData TypeDescription
createdIdIntegerUnique ID of the created merge request.
warningsArrayList of warnings, if any, returned by the API.
{
    "createdId": 29487591,
    "warnings": []
}
{
    "createdId": 13030212,
    "warnings": []
}
{
"createdId": 1778080,
"warnings": []
}
{
"errors": [
    {
        "status": false,
        "code": 9021,
        "message": "Request Add/Update is blocked for the org"
    }
]
}
{
"createdId": 1785155,
"warnings": []
}

Error Code

Error CodeDescriptionReason
8012User already mergedUsers have already been merged. To re-attempt a merge, provide a new, unique requestId.
400requestId can't be null.requestId is not provided.
400toUserId can't be null.,fromUserId can't be null.toUserId or fromUserId are not provided.
9021Request Add/Update is blocked for the child organizationThe child organization lacks the necessary permissions to add a customer merge request.
9006Request Type is invalidEnsure to provide a valid value for type.
9008Request Base Type is invalidEnsure to provide a valid value for baseType.
Body Params
string
required
Defaults to Defaults to CUSTOMER

User type. At present, only CUSTOMER is supported.

string
required
Defaults to Defaults to DELETE

Action that needs to be performed. Only DELETE is supported.

string

Comment, if any.

customerIdentificationInfo
object
required

Customer identification details.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

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