CUSTOMERS
Methods for working with Customers
The essence of the "leads" is similar. It consists of a predefined set of fields and additional accounts created by the administrator of the account. Each customer can be attached to one or more contacts or not attached to one.
Each customer can be assigned a responsibility to differentiate access rights between employees of the account.
The customer has a time period that indicates the position of the customer in the life cycle (business process). The list of time periods can be changed within the account, except for the first and three final system time periods.
Add, update, or delete customersThe method allows you to add customers one by one or in batch, and also update the data for existing customers and delete them.
URL of the methodPOST /api/v2/customers
ParametersParameter | Type | Description |
---|---|---|
add | array | List of added customers |
update | array | The list of existing customers where changes will be made. Everything described for adding is also relevant for updating customers |
delete | array | The array of id deletable leads is separated by commas |
add/name | string | Customer Name |
add/next_date | timestamp | Date and time of the next purchase |
add/created_at | timestamp | Date and time the customer was created |
add/updated_at | timestamp | Date and time of the changes made in the customer card |
add/responsible_user_id | int | id of the user responsible for the customer |
add/created_by | int | id of the user who created the customer |
add/next_price | int | Expected amount |
add/periodicity | int | The frequency of purchases |
add/tags | string | Tags that are attached to the customer. Set as a string string variable, inside a line, separated by commas |
add/period_id | int | id of the digital consumer pipeline time period |
add/contacts_id | array (int) | An array of ids of contacts that will be attached to the customer |
add/company_id | int | id of an existing company that will be attached to the customer |
add/custom_fields | array | Array of additional fields of the "customer" entity |
add/custom_fields//id | int | id of the custom field of the entity "customer" |
add/custom_fields//values | array | Array of values of the custom field |
add/custom_fields//values//value | string | The value of the custom field |
add/custom_fields//values//enum | string | The early identifier of the preset choice for the list or multi-selection |
update/id require |
int | id of the customer to be changed |
update/updated_at require |
timestamp | Date and time of the change |
update/unlink | array | An array containing information to detach a customer from other entity elements. |
update/unlink/contacts_id | array | Array id of unlinked contacts |
update/unlink/company_id | int | id of the company to be uninstalled |
Parameter | Description |
---|---|
id | The unique identifier of the new entity |
request_id | The unique identifier of the entity in the client program, if request_id is not passed in the request, it is automatically generated |
_links | An array containing information about the query |
_links/self | An array containing information about the current request |
_links/self/href | Relative URL of the current request |
_links/self/method | The method of the current request |
_embedded | An array containing information adjacent to the query |
_embedded/items | An array containing information for each individual element |
Response Headers contains the following headers:
Content-Type: application / hal + json
Runtime-Timestamp: 1508320306
Example of a request to add a new customer
Example response- {
- add: [
- {
- name: "Ecosports LLC",
- next_date: "1508878800",
- created_at: "1508533200",
- responsible_user_id: "504141",
- created_by: "504141",
- next_price: "5000",
- periodicity: "7",
- tags: "sales, markers",
- period_id: "15489654",
- contacts_id: [
- "496531"
- ],
- company_id: "475621",
- custom_fields: [
- {
- id: "4400017",
- values: [
- {
- value: "A very important customer"
- }
- ]
- },
- {
- id: "4400021",
- values: [
- "3692471",
- "3692472"
- ]
- },
- {
- id: "4399655",
- values: [
- {
- value: "Madison st, 1",
- subtype: "address_line_1"
- },
- {
- value: "Washington",
- subtype: "city"
- },
- {
- value: "20011",
- subtype: "zip"
- },
- {
- value: "US",
- subtype: "country"
- }
- ]
- }
- ]
- }
- ]
- }
- {
- _links: {
- self: {
- href: "/api/v2/customers",
- method: "post"
- }
- },
- _embedded: {
- items: [
- {
- id: 466812,
- request_id: 0,
- _links: {
- self: {
- href: "/api/v2/customers?id=466812",
- method: "get"
- }
- }
- }
- ]
- }
- }
Example of a change request for a new customer
Example query- {
- update: [
- {
- id: "466791",
- updated_at: "1508619600",
- next_date: "1508878800",
- next_price: "1508706000",
- custom_fields: [
- {
- id: "4400021",
- values: [
- "3692471",
- "3692472",
- "3692473"
- ]
- }
- ]
- }
- ]
- }
- {
- _links: {
- self: {
- href: "/api/v2/customers",
- method: "post"
- }
- },
- _embedded: {
- items: [
- {
- id: 466791,
- request_id: 466791,
- _links: {
- self: {
- href: "/api/v2/customers?id=466791",
- method: "get"
- }
- }
- }
- ]
- }
- }
An example of a request to remove customers.
Example query- {
- delete: [
- "466812",
- "466811",
- "466891"
- ]
- }
- {
- _links: {
- self: {
- href: "/api/v2/customers",
- method: "post"
- }
- },
- _embedded: {
- items: {
- deleted: [
- {
- id: 466815,
- name: "Elizabeth"
- },
- {
- id: 466816,
- name: "Jennifer"
- }
- ]
- }
- }
- }
List of Customers
Method for obtaining a list of customers with the possibility of filtering and pagination.
URL of the methodGET / api / v2 / customers
GET parametersParameter | Description |
---|---|
id | Select the element with the given ID (If this parameter is specified, all the others are ignored). It is possible to transfer in the form of an array consisting of several IDs) |
limit_rows | Number of selectable rows (system limit 500) |
limit_offset | Selection reference (from which row to choose). Works only if limit_rows is also specified |
filter/main_user// | Select the element by the responsible user (you need to transfer the array with the user ID. |
filter/date | Select an element by the date of creation or editing (you need to transfer an array with the parameters type, from, to) |
filter/date/type | Select an item by creation or editing date. Date type: create or modify. |
filter/date/from | The date from which to start the selection. In the format MM / HH / YYYY. The parameter is set in conjunction with the filter / date / type parameter. |
filter/date/to | The date to which you want to select. In the format MM / HH / YYYY. The parameter is set in conjunction with the filter / date / type parameter. |
filter/next_date | Select element by date trace. purchase (you need to pass an array with the parameters from, to) |
filter/next_date/from | Similarly filter / date / from |
filter/next_date/to | Similarly filter / date / to |
Response Headers contains the following headers:
Content-Type: application / hal + json
Runtime-Timestamp: 1508320306
Parameter | Type | Description |
---|---|---|
id | int | Unique identifier of the "customer" |
name require |
string | Element name |
responsible_user_id | int | id of the user responsible for the customer |
created_by | int | id of the user who created the customer |
created_at | timestamp | Date and time the customer was created |
updated_at | timestamp | Date and time of the change of the customer |
account_id | int | id of the account in which the customer was created |
updated_by | int | id of the user who changed the customer |
is_deleted | bool | The customer was deleted or not deleted. |
main_contact | array | An array containing information about the main contact of the customer |
main_contact/id | int | id of the main contact of the customer |
tags | array | An array containing information on tags attached to a given customer |
tags/id | int | id of the tag attached to this customer |
tags/name | string | The name of the tag attached to this customer |
custom_fields | array | An array containing information on additional fields specified for a given customer |
custom_fields/id | int | id of the additional field |
custom_fields/name | string | Name of the additional field |
custom_fields/values | array | An array containing information on additional fields specified for a given customer |
custom_fields/values//value | string | The value of the additional field |
custom_fields/values//enum | string | Early identifier of the preset option for the list or multi-selection |
custom_fields/is_system | bool | Is the extra field systemic |
contacts | array | An array containing information on contacts attached to a given customer |
contacts/id | int | id of the contact attached to the lead |
company | array | An array containing information about a company that is attached to a given customer |
company/id | int | id of the company that is attached to this lead |
company/name | string | the name of the company that is attached to the lead |
next_price | int | Expected amount |
closest_task_at | timestamp | The time of the nearest task for the given customer |
period_id | timestamp | Unique period identifier, digital pipeline of customers |
periodicity | int | Periodicity |
next_date require |
timestamp | Next purchase date |
_links | array | Array containing information about the request |
_links/self | array | An array containing information about the current request |
_links/self/href | string | Relative URL of the current request |
_links/self/method | string | Method of the current request |
_embedded | array | An array containing information adjacent to the query |
_embedded/items | array | An array containing information for each individual element |
Example GET request list of customers created on 10/10/2017 https://example.amocrm.com/api/v2/customers?filter[date][type]=create&filter[date][from]=10.10.2017
Example response- {
- _links: {
- self: {
- href: "/api/v2/customers",
- method: "get"
- }
- },
- _embedded: {
- items: [
- {
- id: 466791,
- name: "Catherine",
- responsible_user_id: 504141,
- created_by: 504141,
- created_at: 1508500193,
- updated_at: 1508659120,
- account_id: 13667499,
- updated_by: 504141,
- is_deleted: false,
- main_contact: {
- id: 1099181,
- _links: {
- self: {
- href: "/api/v2/contacts?id=1099181",
- method: "get"
- }
- }
- },
- tags: [
- {
- id: 61869,
- name: "Sales"
- },
- {
- id: 61870,
- name: "Markers"
- }
- ],
- custom_fields: [
- {
- id: 4400017,
- name: "Remarks",
- values: [
- {
- value: "Delayed payment"
- }
- ],
- is_system: false
- },
- {
- id: 4400021,
- name: "Multi-select",
- values: [
- {
- value: "3",
- enum: "3692471"
- },
- {
- value: "4",
- enum: "3692472"
- },
- {
- value: "5",
- enum: "3692473"
- }
- ],
- is_system: false
- },
- ],
- contacts: {
- id: [
- 1099181
- ],
- _links: {
- self: {
- href: "/api/v2/contacts?id=1099181",
- method: "get"
- }
- }
- },
- company: {
- id: 1099180,
- name: SpetsGorStroy LLC,
- _links: {
- self: {
- href: "/api/v2/companies?id=1099180",
- method: "get"
- }
- }
- },
- next_price: 1508706000,
- closest_task_at: 1508705940,
- period_id: 112804,
- periodicity: 0,
- next_date: 1508878800,
- _links: {
- self: {
- href: "/api/v2/customers?id=466791",
- method: "get"
- }
- }
- }
- ]
- }
- }
An example of integration working with the "Customer"
To add a customer, you need to describe an array containing information about the customer. Our API also supports the simultaneous addition of multiple customers. To do this, we place several arrays in the query array, each of which describes the necessary data for creating the corresponding customer.
Example of integration- 'name' => 'Jerry',
- 'next_date' => '1508792400',
- 'created_at' => '1508619600',
- 'responsible_user_id' => 504141,
- 'created_by' => 504141,
- 'next_price' => 7000,
- 'periodicity' => 7,
- 'tags' => "Sales, Pencils",
- 'period_id' => 153795,
- 'company_id' => 356463,
- 'id' => 4400017,
- 'value' => "Important Customer"
- )
- )
- ),
- 'id' => 4400021,
- "3692469",
- "3692470",
- "3692471"
- )
- ),
- 'id'=>458615, #The unique identifier of the additional field to be filled
- 'value' => 'Address line 1',
- 'subtype' => 'address_line_1',
- ),
- 'value' => 'Address line 2',
- 'subtype' => 'address_line_2',
- ),
- 'value' => 'City',
- 'subtype' => 'city',
- ),
- 'value' => 'State',
- 'subtype' => 'state',
- ),
- 'value' => '203',
- 'subtype' => 'zip',
- ),
- 'value' => 'US',
- 'subtype' => 'country',
- )
- )
- )
- )
- ),
- 'name'=>'Jason',
- 'created_at'=>1298904164,
- 'next_date' => '1508782500',
- 'next_price'=>600200,
- 'responsible_user_id'=>215309,
- #A non-standard additional field such as the "multi-select" that we created
- 'id'=>426106,
- 1237756,
- 1237758
- )
- )
- )
- )
- );
- /* Now prepare the data needed to query the server */
- $subdomain='test'; #Our account - subdomain
- #Generate a link for the request
- $link='https://'.$subdomain.'.amocrm.com/api/v2/customers';
- /* We need to initiate a request to the server. We use the cURL library (supplied as part of PHP). More about
- work with this
- library you can
- read the manual. */
- #Set the necessary options for the cURL session
- curl_setopt($curl,CURLOPT_COOKIEFILE,dirname(__FILE__).'/cookie.txt'); #PHP>5.3.6 dirname(__FILE__) -> __DIR__
- curl_setopt($curl,CURLOPT_COOKIEJAR,dirname(__FILE__).'/cookie.txt'); #PHP>5.3.6 dirname(__FILE__) -> __DIR__
- /* Now we can process the response received from the server. This is an example. You can process the data in your own way. */
- $code=(int)$code;
- 301=>'Moved permanently',
- 400=>'Bad request',
- 401=>'Unauthorized',
- 403=>'Forbidden',
- 404=>'Not found',
- 500=>'Internal server error',
- 502=>'Bad gateway',
- 503=>'Service unavailable'
- );
- try
- {
- #If the response code is not 200 or 204, we return an error message
- if($code!=200 && $code!=204)
- }
- catch(Exception $E)
- {
- }
Transactions
A transaction is an entity that describes the basic characteristics of a purchase (date and amount). Is an addition for the "customer".
Adding and Deleting TransactionsThe method allows you to add and delete transactions one by one or batch.
ParametersParameter | Type | Description |
---|---|---|
add | array | List of added transactions |
add/customer_id | int | Unique customer ID |
add/date | timestamp | Date of purchase |
add/price | int | Amount of the purchase made |
add/comment | string | Comment for purchase |
add/next_date | timestamp | Expected date of purchase |
add/next_price | int | Expected purchase amount |
delete | array(int) | An array with unique transaction IDs that are specified for deletion purposes |
Parameter | Type | Description |
---|---|---|
items | array(int) | The array of id created deals |
_links | array | Array containing information about the request |
_links/self | array | An array containing information about the current request |
_links/self/href | string | Relative URL of the current request |
_links/self/method | string | Method of the current request |
_embedded | array | An array containing information adjacent to the query |
_embedded/items | array | An array containing information for each individual element |
Response Headers contains the following headers:
Content-Type: application / hal + json
Runtime-Timestamp: 1508320306
Example of a request to add a transaction
Example query- {
- add: [
- {
- customer_id: "466791",
- date: "1507582800",
- price: "15000",
- comment: "Everything went well",
- next_date: "1508878800",
- next_price: "20000"
- }
- ]
- }
- {
- _links: {
- self: {
- href: "/api/v2/transactions",
- method: "post"
- }
- },
- _embedded: {
- items: [
- {
- id: 5396,
- _links: {
- self: {
- href: "/api/v2/transactions?id=5396",
- method: "get"
- }
- }
- }
- ]
- }
- }
Example request to delete transactions
Example query- {
- delete: [
- "4589",
- "4588",
- "4587"
- ]
- }
Method for adding and modifying the comment of an existing transaction. If you change the comment of an existing transaction, the transaction itself is not updated.
Method URLPOST / api / v2 / transactions /
ParametersParameter | Type | Description |
---|---|---|
update | array | List of added / modified comments |
update/transaction_id require |
int | Unique transaction identifier |
update/comments require |
string | Comment text |
Parameter | Type | Description |
---|---|---|
items | array | Array of added / modified comments |
id | int | id of the added / changed comment |
_links | array | Array containing information about the request |
_links/self | array | An array containing information about the current request |
_links/self/href | string | Relative URL of the current request |
_links/self/method | string | Method of the current request |
_embedded | array | An array containing information adjacent to the query |
_embedded/items | array | An array containing information for each individual element |
Response Headers contains the following headers:
Content-Type: application / hal + json
Runtime-Timestamp: 1508320306
- {
- update: [
- {
- transaction_id: "5396",
- comment: "Draw up a contract"
- }
- ]
- }
- {
- _links: {
- self: {
- href: "/api/v2/transactions",
- method: "post"
- }
- },
- _embedded: {
- items: [
- {
- id: 5396,
- _links: {
- self: {
- href: "/api/v2/transactions?id=5396",
- method: "get"
- }
- }
- }
- ]
- }
- }
- 'price'=>3000,
- 'date'=>1476813651,
- 'customer_id'=>33221355,
- 'comment' => "example"
- ),
- 'price'=>9500,
- 'date'=>14762143651,
- 'customer_id'=>75321111,
- 'comment' => "example 2"
- )
- );
- /* Now prepare the data needed to query the server */
- $subdomain='test'; #Our account is a subdomain
- #Generate a link for the request
- $link='https://'.$subdomain.'.amocrm.com/api/v2/transactions';
- /* We need to initiate a request to the server. We use the cURL library (supplied as part of PHP). More about
- work with this
- library you can
- read the manual. */
- #Set the necessary options for the cURL session
- curl_setopt($curl,CURLOPT_COOKIEFILE,dirname(__FILE__).'/cookie.txt'); #PHP>5.3.6 dirname(__FILE__) -> __DIR__
- curl_setopt($curl,CURLOPT_COOKIEJAR,dirname(__FILE__).'/cookie.txt'); #PHP>5.3.6 dirname(__FILE__) -> __DIR__
- /* Now we can process the response received from the server. This is an example. You can process the data in your own way. */
- $code=(int)$code;
- 301=>'Moved permanently',
- 400=>'Bad request',
- 401=>'Unauthorized',
- 403=>'Forbidden',
- 404=>'Not found',
- 500=>'Internal server error',
- 502=>'Bad gateway',
- 503=>'Service unavailable'
- );
- try
- {
- #If the response code is not 200 or 204, we return an error message
- if($code!=200 && $code!=204)
- }
- catch(Exception $E)
- {
- }
Transaction List
A method for obtaining a list of transactions with the ability to filter.
Method URLGET / api / v2 / transactions
GET parametersParameters | Description |
---|---|
id | Select transaction with given id |
customer_id | Select transaction that is tied to the customer with the specified id |
limit_rows | Number of selectable rows (system limit 500) |
limit_offset | Selection reference (from which row to choose). Works only if limit_rows is also specified |
Parameter | Type | Description |
---|---|---|
items | array | Array of selected transactions |
items/id | int | Unique transaction identifier |
items/created_by | int | ID of the user who created the transaction |
items/created_at | timestamp | Date and time the transaction was created |
items/updated_at | timestamp | Date and time of transaction change |
items/account_id | int | id of the account on which the transaction was created |
items/updated_by | int | id of the user who changed the transaction |
items/is_deleted | bool | Deleted transaction or not |
items/comment | string | Comment |
items/price | int | Purchase amount |
items/date | timestamp | Date of purchase |
items/customer | array | An array containing information about the customer |
items/customer/id | int | id customer |
_links | array | Array containing information about the request |
_links/self | array | An array containing information about the current request |
_links/self/href | string | Relative URL of the current request |
_links/self/method | string | Method of the current request |
_embedded | array | An array containing information adjacent to the query |
_embedded/items | array | An array containing information for each individual element |
Example GET request list of customers created on 10/10/2017 https://example.amocrm.com/api/v2/transactions?limit_rows=50&customer_id=46879
Example response- {
- _links: {
- self: {
- href: "/api/v2/transactions",
- method: "get"
- }
- },
- _embedded: {
- items: [
- {
- id: 5400,
- created_by: 504141,
- created_at: 1508671514,
- updated_at: 1508671514,
- account_id: 13667499,
- updated_by: 504141,
- is_deleted: false,
- comment: "",
- price: 55555,
- date: 1508360400,
- customer: {
- id: 466791,
- _links: {
- self: {
- href: "/api/v2/customers?id=466791",
- method: "get"
- }
- }
- },
- _links: {
- self: {
- href: "/api/v2/transactions?id=5400",
- method: "get"
- }
- }
- },
- {
- id: 5399,
- created_by: 504141,
- created_at: 1508665872,
- updated_at: 1508665872,
- account_id: 13667499,
- updated_by: 504141,
- is_deleted: false,
- comment: "",
- price: 15000,
- date: 1507582800,
- customer: {
- id: 466791,
- _links: {
- self: {
- href: "/api/v2/customers?id=466791",
- method: "get"
- }
- }
- },
- _links: {
- self: {
- href: "/api/v2/transactions?id=5399",
- method: "get"
- }
- }
- }
- ]
- }
- }
Stages of customers
Stages of customer is a sequence of steps that a potential customer (customer) is taking on the pipeline of customers before buying. In amoCRM, you can create your own periods to track the progress of the customer. The customer pipeline can contain 10 periods "before purchase" (including "recently bought", "bought today" and "not bought"). The administrator of the account can configure the periods on the Digital Pipeline page. These methods are only available to the account administrator
Add, delete, and update customer stagesThe method allows you to change data by period. When changing, you need to transfer a complete list of periods, including those already existing. When deleting a period, you need to exclude it from the query.
Method URLPOST / api / v2 / customers_periods
ParametersParameter | Type | Description |
---|---|---|
update | array | Редактирование периодов покупателя |
update//period | int | Number of days in the period. IMPORTANT!!! This parameter determines the fixed length of the period and does not coincide with the number of days "before purchase". The number of days before the purchase is calculated by adding this parameter for all periods from the "purchase day" to the right to the left. For example: to get "90, 30 and 10 days before the purchase," you need to create 3 periods of 10, 20 and 60 days: 1) 10 + 20 = 30 days before the purchase. 2) 30 + 60 = 90 days before purchase. |
update//id | int | The unique identifier of the pipeline. (If the id is not passed, a new period will be created). |
update//color | string | Period color |
update//sort | int | The period ordinal of the period when displayed (Periods are displayed to the right of the left starting from the "purchase day"). |
Code | Sample |
---|---|
#fffeb2 | color example |
#fffd7f | color example |
#fff000 | color example |
#ffeab2 | color example |
#ffdc7f | color example |
#ffce5a | color example |
#ffdbdb | color example |
#ffc8c8 | color example |
#ff8f92 | color example |
#d6eaff | color example |
#c1e0ff | color example |
#98cbff | color example |
#ebffb1 | color example |
#deff81 | color example |
#87f2c0 | color example |
#f9deff | color example |
#f3beff | color example |
#ccc8f9 | color example |
#eb93ff | color example |
#f2f3f4 | color example |
#e6e8ea | color example |
Parameter | Type | Description |
---|---|---|
items | array | An array of created / modified periods |
items/id | int | Unique period identifier |
items//type | string | The type of the period (before, after). The after type can only be edited. |
items//period | int | Number of days in the period |
items//color | string | The color of the period |
items//sort | int | The period ordinal of the period in the display |
items/after_buy | int | Number of days after purchase (period "not bought") |
_links | array | Array containing information about the request |
_links/self | array | An array containing information about the current request |
_links/self/href | string | Relative URL of the current request |
_links/self/method | string | Method of the current request |
_embedded | array | An array containing information adjacent to the query |
_embedded/items | array | An array containing information for each individual element |
Response Headers contains the following headers:
Content-Type: application / hal + json
Runtime-Timestamp: 1508320306
- {
- update: [
- {
- period: "5",
- id: "15563",
- color: "#000000",
- sort: "1"
- }
- ]
- }
- {
- _links: {
- self: {
- href: "/api/v2/customers_periods",
- method: "post"
- }
- },
- _embedded: {
- items: [
- {
- id: 112805,
- type: "after",
- period: 60,
- color: "#fd5598",
- sort: 0,
- after_buy: 60,
- _links: {
- self: {
- href: "/api/v2/customers_periods",
- method: "get"
- }
- }
- }
- ]
- }
- }
- [
- "period" => 10,
- "color" => "#fffd7f",
- "sort" => 0
- ],
- [
- "id" => 110412,
- "period" => 20,
- "color" => "#ffdc7f",
- "sort" => 1
- ],
- [
- "id" => 110157,
- "period" => 60,
- "color" => "#ccc8f9",
- "sort" => 2
- ],
- );
- /* Now prepare the data needed to query the server */
- $subdomain='test'; #Our account is a subdomain
- #Generate a link for the request
- $link='https://'.$subdomain.'.amocrm.com/api/v2/customers_periods';
- /* We need to initiate a request to the server. We use the cURL library (supplied as part of PHP). More about
- work with this
- library you can
- read the manual. */
- #Set the necessary options for the cURL session
- curl_setopt($curl,CURLOPT_COOKIEFILE,dirname(__FILE__).'/cookie.txt'); #PHP>5.3.6 dirname(__FILE__) -> __DIR__
- curl_setopt($curl,CURLOPT_COOKIEJAR,dirname(__FILE__).'/cookie.txt'); #PHP>5.3.6 dirname(__FILE__) -> __DIR__
- /* Now we can process the response received from the server. This is an example. You can process the data in your own way. */
- $code=(int)$code;
- 301=>'Moved permanently',
- 400=>'Bad request',
- 401=>'Unauthorized',
- 403=>'Forbidden',
- 404=>'Not found',
- 500=>'Internal server error',
- 502=>'Bad gateway',
- 503=>'Service unavailable'
- );
- try
- {
- #If the response code is not 200 or 204, we return an error message
- if($code!=200 && $code!=204)
- }
- catch(Exception $E)
- {
- }
List of customer stages
Method for obtaining a list of periods. The GET request is sent without any additional parameters.
Method URLGET / api / v2 / customers_periods
Response parametersParameter | Type | Description |
---|---|---|
items | array | An array of created / modified periods |
items/id | int | Unique period identifier |
items//type | string | The type of the period (before, after). The after type can only be edited. |
items//period | int | Number of days in the period |
items//color | string | The color of the period |
items//sort | int | The period ordinal of the period in the display |
items/after_buy | int | Number of days after purchase (period "not bought") |
_links | array | Array containing information about the request |
_links/self | array | An array containing information about the current request |
_links/self/href | string | Relative URL of the current request |
_links/self/method | string | Method of the current request |
_embedded | array | An array containing information adjacent to the query |
_embedded/items | array | An array containing information for each individual element |
Example GET request list of stages of customers https://example.amocrm.com/api/v2/customers_periods
Example response- {
- _links: {
- self: {
- href: "/api/v2/customers_periods",
- method: "get"
- }
- },
- _embedded: {
- items: [
- {
- id: 112815,
- type: "before",
- period: 5,
- color: "#e6e8ea",
- sort: 1,
- before_buy: 5
- },
- {
- id: 112805,
- type: "after",
- period: 60,
- color: "#fd5598",
- sort: 0,
- after_buy: 60
- }
- ]
- }
- }