PayOrc
Invoices

Invoice Customers

Create, update, activate, deactivate, and delete customers for invoices.

Invoice Customers

Version: 3.0.0

Generate an API Key for the Invoice channel before making requests.

Invoice customers are the entities you bill for products or services. Create customer profiles once, then reference them when creating invoices. Each customer stores contact information, a billing address, and a shipping address.

Reusable invoice customers save time and ensure consistent billing information across all invoices. Create them once, reference them in multiple invoices.

Every create and list response returns two identifiers: a display customer_id (a short sequence number) and a data_id (an encrypted token). Always send the data_id token when updating, activating, deactivating, deleting, or fetching a customer. When creating an invoice, pass this data_id token as the invoice's customer_id field.

Available Operations

ActionMethodEndpointDescription
Create CustomerPOSThttps://api.payorc.com/invoice/v1/customers/addCreate a new customer
Update CustomerPOSThttps://api.payorc.com/invoice/v1/customers/updateModify customer details
DeactivatePOSThttps://api.payorc.com/invoice/v1/customers/deactivateDisable customer
ActivatePOSThttps://api.payorc.com/invoice/v1/customers/activateRe-enable a deactivated customer
DeletePOSThttps://api.payorc.com/invoice/v1/customers/deletePermanently remove a customer
Get DetailsGEThttps://api.payorc.com/invoice/v1/customers/detailsFetch a single customer
List CustomersGEThttps://api.payorc.com/invoice/v1/customers/listList all customers

Authentication

HeaderTypeDescription
merchant-keyStringYour merchant key
merchant-secretStringYour merchant secret

Create Customer

Create a new customer profile for invoicing.

Endpoint

MethodURL
POSThttps://api.payorc.com/invoice/v1/customers/add

Please use the test credentials for sandbox testing.

Request Body

FieldTypeRequiredDescription
customer_details.name_prefixStringYesOne of Mr., Miss, or Entity
customer_details.nameStringYesCustomer full name (1–50 characters)
customer_details.emailStringYesCustomer email address (must be unique per merchant)
customer_details.codeNumberYesCountry dial code (e.g., 91 for India, 971 for UAE)
customer_details.mobileNumberYesCustomer mobile number (validated against the dial code)
billing_details.addressStringNoBilling street address (max 70 characters)
billing_details.countryStringYesISO 3166-1 alpha-2 country code
billing_details.stateStringYesState or province
billing_details.cityStringYesCity
billing_details.zip_codeStringNoPostal/ZIP code (5–6 characters)
shipping_details.same_as_billing_addressStringYesyes or no
shipping_details.addressStringNoShipping street address (max 70 characters; used when same_as_billing_address is no)
shipping_details.countryStringNoISO 3166-1 alpha-2 country code
shipping_details.stateStringNoState or province
shipping_details.cityStringNoCity
shipping_details.zip_codeStringNoPostal/ZIP code (5–6 characters)

Code Examples

curl -X POST https://api.payorc.com/invoice/v1/customers/add \
  -H "Content-Type: application/json" \
  -H "merchant-key: YOUR_MERCHANT_KEY" \
  -H "merchant-secret: YOUR_MERCHANT_SECRET" \
  -d '{
    "customer_details": {
        "name_prefix": "Miss",
        "name": "Pooja K",
        "email": "[email protected]",
        "code": "91",
        "mobile": "9991234567"
    },
    "billing_details": {
        "address": "Po Box 12322, address",
        "country": "IN",
        "state": "Maharashtra",
        "city": "Nagpur",
        "zip_code": "44044"
    },
    "shipping_details": {
        "same_as_billing_address": "no",
        "address": "Po Box 12322",
        "country": "IN",
        "state": "Maharashtra",
        "city": "Nagpur",
        "zip_code": "54044"
    }
  }'

Example Response

{
    "data": {
        "customer_id": "0000000261",
        "data_id": "b0RENkJZcVV2L3RM"
    },
    "message": "Client Added successfully.",
    "status": "success",
    "code": "00"
}

Use the returned data_id token when updating this customer or when referencing them in the invoice customer_id field.


Update Customer

Modify details of an existing customer. All customer, billing, and shipping fields follow the same validation rules as Create Customer.

Endpoint

MethodURL
POSThttps://api.payorc.com/invoice/v1/customers/update

Please use the test credentials for sandbox testing.

Request Body

FieldTypeRequiredDescription
customer_details.data_idStringYesEncrypted token of the customer to update
customer_details.name_prefixStringYesOne of Mr., Miss, or Entity
customer_details.nameStringYesCustomer full name
customer_details.emailStringYesEmail address
customer_details.codeNumberYesCountry dial code
customer_details.mobileNumberYesMobile number
billing_detailsObjectYesBilling details (replaces existing)
shipping_detailsObjectYesShipping details (replaces existing)

Code Examples

curl -X POST https://api.payorc.com/invoice/v1/customers/update \
  -H "Content-Type: application/json" \
  -H "merchant-key: YOUR_MERCHANT_KEY" \
  -H "merchant-secret: YOUR_MERCHANT_SECRET" \
  -d '{
    "customer_details": {
        "data_id": "b0RENkJZcVV2L3RM",
        "name_prefix": "Miss",
        "name": "Pooja Kushwaha",
        "email": "[email protected]",
        "code": "91",
        "mobile": "9991234567"
    },
    "billing_details": {
        "address": "456 New Street",
        "country": "AE",
        "state": "Dubai",
        "city": "Dubai",
        "zip_code": "12345"
    },
    "shipping_details": {
        "same_as_billing_address": "no",
        "address": "Po Box 12322",
        "country": "IN",
        "state": "Maharashtra",
        "city": "Nagpur",
        "zip_code": "54044"
    }
  }'

Example Response

{
    "message": "Client updated successfully.",
    "status": "success",
    "code": "00"
}

Deactivate Customer

Deactivate a customer so they cannot be used for new invoices.

Endpoint

MethodURL
POSThttps://api.payorc.com/invoice/v1/customers/deactivate

Please use the test credentials for sandbox testing.

Request Body

FieldTypeRequiredDescription
data_idStringYesEncrypted token of the customer to deactivate

Code Examples

curl -X POST https://api.payorc.com/invoice/v1/customers/deactivate \
  -H "Content-Type: application/json" \
  -H "merchant-key: YOUR_MERCHANT_KEY" \
  -H "merchant-secret: YOUR_MERCHANT_SECRET" \
  -d '{
    "data_id": "b0RENkJZcVV2L3RM"
  }'

Example Response

{
    "message": "Client deactivated successfully",
    "status": "success",
    "code": "00"
}

Deactivated customers can be reactivated at any time. They are not deleted — just hidden from customer selection when creating new invoices.


Activate Customer

Reactivate a previously deactivated customer.

Endpoint

MethodURL
POSThttps://api.payorc.com/invoice/v1/customers/activate

Please use the test credentials for sandbox testing.

Request Body

FieldTypeRequiredDescription
data_idStringYesEncrypted token of the customer to activate

Code Examples

curl -X POST https://api.payorc.com/invoice/v1/customers/activate \
  -H "Content-Type: application/json" \
  -H "merchant-key: YOUR_MERCHANT_KEY" \
  -H "merchant-secret: YOUR_MERCHANT_SECRET" \
  -d '{
    "data_id": "b0RENkJZcVV2L3RM"
  }'

Example Response

{
    "message": "Client activated successfully",
    "status": "success",
    "code": "00"
}

Delete Customer

Permanently delete a customer. This cannot be undone.

Endpoint

MethodURL
POSThttps://api.payorc.com/invoice/v1/customers/delete

Please use the test credentials for sandbox testing.

Request Body

FieldTypeRequiredDescription
data_idStringYesEncrypted token of the customer to delete

Code Examples

curl -X POST https://api.payorc.com/invoice/v1/customers/delete \
  -H "Content-Type: application/json" \
  -H "merchant-key: YOUR_MERCHANT_KEY" \
  -H "merchant-secret: YOUR_MERCHANT_SECRET" \
  -d '{
    "data_id": "b0RENkJZcVV2L3RM"
  }'

Example Response

{
    "message": "Client deleted successfully",
    "status": "success",
    "code": "00"
}

Deleting a customer is permanent and cannot be undone. Existing invoices that reference this customer will retain the data, but the customer cannot be used in new invoices.


Get Customer Details

Retrieve details for a single customer.

Endpoint

MethodURL
GEThttps://api.payorc.com/invoice/v1/customers/details?data_id=DATA_ID

Pass the encrypted data_id token (not the display customer_id) as the query parameter. Please use the test credentials for sandbox testing.

Query Parameters

ParameterTypeRequiredDescription
data_idStringYesEncrypted token of the customer to fetch

Code Examples

curl -X GET "https://api.payorc.com/invoice/v1/customers/details?data_id=b0RENkJZcVV2L3RM" \
  -H "merchant-key: YOUR_MERCHANT_KEY" \
  -H "merchant-secret: YOUR_MERCHANT_SECRET"

Example Response

{
    "data": {
        "customer_details": {
            "customer_id": "0000000261",
            "data_id": "OVV0cGU4b2MraUF",
            "name_prefix": "Mr.",
            "name": "Rahul K",
            "email": "[email protected]",
            "code": "971",
            "mobile": "9991234567"
        },
        "billing_details": {
            "address": "Po Box 12322, address",
            "country": "AE",
            "state": "Dubai",
            "city": "Dubai",
            "zip_code": "44044"
        },
        "shipping_details": {
            "same_as_billing_address": "no",
            "address": "Po Box 12322",
            "country": "IN",
            "state": "Madhya Pradesh",
            "city": "Jabalpur",
            "zip_code": "54044"
        },
        "status": "Active",
        "submerchant_name": "Qwerty Tech"
    },
    "message": "Details fetched successfully.",
    "status": "success",
    "code": "00"
}

List Customers

Retrieve a paginated list of all customers.

Endpoint

MethodURL
GEThttps://api.payorc.com/invoice/v1/customers/list

Please use the test credentials for sandbox testing.

Query Parameters

ParameterTypeRequiredDescription
perpageIntegerYesNumber of items per page (1–1000)
pageIntegerYesPage number (1–1000)
statusStringNoFilter by status (Active or Deactivated)
name_or_email_mobileStringNoSearch by name, email, or mobile number
billing_countryStringNoFilter by billing country (ISO 3166-1 alpha-2 code)
customer_idStringNoFilter by the display customer ID
from_dateDateNoFilter by customer created date, from this date (format: YYYY-MM-DD)
to_dateDateNoFilter by customer created date, up to this date (format: YYYY-MM-DD). Must be ≥ from_date

Code Examples

curl -X GET "https://api.payorc.com/invoice/v1/customers/list?perpage=10&page=1" \
  -H "merchant-key: YOUR_MERCHANT_KEY" \
  -H "merchant-secret: YOUR_MERCHANT_SECRET"

Example Response

{
    "data": [
        {
            "customer_details": {
                "customer_id": "0000000261",
                "data_id": "OVV0cGU4b2MraUF",
                "de_customer_id": "0000000261",
                "name_prefix": "Mr.",
                "name": "Rahul K",
                "email": "[email protected]",
                "mobile": "+971 9991234567"
            },
            "billing_details": {
                "address": "Po Box 12322, address",
                "country": "AE",
                "state": "Dubai",
                "city": "Dubai",
                "zip_code": "44044"
            },
            "shipping_details": {
                "same_as_billing_address": "no",
                "address": "Po Box 12322",
                "country": "IN",
                "state": "Madhya Pradesh",
                "city": "Jabalpur",
                "zip_code": "54044"
            },
            "status": "Active",
            "created_date": "19-01-2024 16:41:05",
            "first_txn_date": "-",
            "last_txn_date": "-",
            "submerchant_name": "Qwerty Tech"
        }
    ],
    "message": "List fetched successfully.",
    "status": "success",
    "code": "00",
    "total_records": 1
}

On this page