---
# System prepended metadata

title: 'The Instruction of API Testing for Contracted Vendors '
tags: [合作店家]

---

The scenarios we are planning are as below:

1. There will be an interface, either on a website or an app developed by the contracted vendors, to let user input the mobile phone number he/she used in the Custos membership registration before the transaction. The contracted vendors will call API-P02 to verify the number.
2. If the verification has passed, the contracted vendors will know that this user is a valid Custos member. They can connect their own membership serial number with the Custos membership and save in their database. 
3. The contracted vendors will call API-P01 to send back the transaction details when this user has transaction with them afterwards since they already know this user is a valid Custos member. API-P01 will not be called for other users who are not Custos members.

Contracted vendors can also call two APIs in one transaction. API-P02 first to verify the Custos membership and then API-P01 for sending the transaction data back to Custos.

**API-P01 URL https://dev-api.custoscarbon.com/APP/setData/setTransactionRecords**

**Request Sample**
``` json
{
  "corp_data_id": "5",                  //The serial number of contracted vendor defined by Custos
  "vendor_item_id": "XXX",              //The internal product id defined by contracted vendor. Put empty string if it doesn't exist
  "item_name": "xxx",                   //The internal product name defined by contracted vendor
  "to_emp_phone": "0912345678",         //The mobile phone number for Custos user stored in contracted vendor's database after API-P02 verification
  "category_id ": "4",                  //Type of transaction, rent is 4, purchase is 5, refund is 7
  "total_amt": "200",                   //The amount of transaction
  "create_date": "2023-08-21 10:03:28", //Transaction time
  "language_setting": "zh-TW"           //Defined by Custos
}
```

**API-P02 URL https://dev-api.custoscarbon.com/APP/getData/checkCustosMembership**

**Request Sample**
```json
{
  "vendor_corp_data_id": "5", //The serial number of contracted vendor defined by Custos
  "emp_phone": "0912345678",  //The mobile phone number user used in the Custos membership registration
  "language_setting": "zh-TW" //Defined by Custos
}
```