Introduction
Welcome to the Trincico 1.0 API.
Plans
Plan object
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "Basic",
"price": 0,
"currency": "usd",
"interval": "year",
"interval_count": 1,
"active": true,
"is_recommended": false,
"weight": 1,
"trial_period_days": 0,
"is_default": true
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the plan. |
| name | string(30) | Name of the plan. |
| price | bigint | The amount a user should pay to subscribe to this plan. |
| currency | string | Currency in which user will pay in this plan. Maximum length is 3. |
| interval | string | One of: month, year. |
| interval_count | int | Indicates the counter for inteval. |
| active | bool | Indicates whether the plan is active or not. |
| is_recommended | bool | Indicate if the plan is recommended. Only one plan can be recommended. |
| weight | int | The order of priority of the plan. Indicates if one plan is superior to another. |
| trial_period_days | int | If the plan includes trial days, expresses the number in days. |
| is_default | bool | Whether the plan is the default one or not. Only one plan can be default. |
List plans
Get the list of current active plans. Note that only active plans will be in the response.
GET /plans/
curl -X GET 'https://backend-staging.trincico.net/plans/' \
-H 'Content-Type: application/json'
On success
[
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "Basic",
"price": 0,
"currency": "usd",
"interval": "year",
"interval_count": 1,
"active": true,
"is_recommended": false,
"weight": 1,
"trial_period_days": 0,
"is_default": true,
"features": [
{
"name": "action 1",
"code": "action_1",
"max_allowed_value": 3,
"metadata": null
},
{
"name": "action 2",
"code": "actions_2",
"max_allowed_value": 3,
"metadata": null
},
{
"name": "action 3",
"code": "action_3",
"max_allowed_value": 3,
"metadata": null
}
]
}
]
Request
Authentication
No needed
Body
No needed
Success response
Array<Plan>
Error response
| Code | Message |
|---|---|
| internal_error | Opps something went wrong. |
Payment methods
Payment method object
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "Stripe",
"payout_enable": true,
"is_default": true
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the payment method. |
| type | string | One of: stripe. |
| payout_enabled | boolean | Indicates whether the payout is enabled. |
| is_default | boolean | Indicates whether this method is the default. Only one default method is allowed. |
List methods
Get the list of current active payment methods. Note that only active methods will be in the response.
GET /payment-methods/
curl -X GET 'https://backend-staging.trincico.net/payment-methods/' \
-H 'Content-Type: application/json'
On success
[
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "Stripe",
"payout_enable": true,
"is_default": true
}
]
Request
Authentication
No needed
Body
No needed
Success response
Array<PaymentMethod Object>
Error response
| Code | Message |
|---|---|
| internal_error | Opps something went wrong. |
Subscriptions
Subscription object
{
"data": {
"id": "412e598e-ee20-4946-8cb7-4ded0b33019e",
"start_at": 1697815942,
"end_at": 1700494342,
"canceled_at": null,
"method_details": {
"type": "card",
"brand": "mastercard",
"last4": "4444",
"checks": {
"cvc_check": "pass",
"address_line1_check": null,
"address_postal_code_check": null
},
"wallet": null,
"country": "US",
"funding": "credit",
"exp_year": 2024,
"networks": {
"available": [
"mastercard"
],
"preferred": null
},
"exp_month": 12,
"fingerprint": "IKMS1UJn8dAWCt39",
"generated_from": null,
"three_d_secure_usage": {
"supported": true
}
},
"next_plan": null,
"status": "active",
"last_payment": {
"id": "4bf68f6e-57c5-4a22-b4a2-0affee2884f0",
"reference": "815884",
"gross_amount": 1000,
"net_amount": 1000,
"fee_amount": 0,
"fee_percent": "0.00",
"details": {
"type": "card",
"brand": "visa",
"last4": "4242",
"checks": {
"cvc_check": "pass",
"address_line1_check": null,
"address_postal_code_check": null
},
"wallet": null,
"country": "US",
"funding": "credit",
"exp_year": 2024,
"networks": {
"available": [
"visa"
],
"preferred": null
},
"exp_month": 12,
"fingerprint": "CwUhIMmImN831aPl",
"generated_from": null,
"three_d_secure_usage": {
"supported": true
}
},
"currency": "usd",
"created_at": 1697815881,
"status": "completed",
"target": "subscription",
"method": "stripe",
"invoice": {},
"plan": {
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e52",
"name": "Pro Monthly",
"price": 1000,
"currency": "usd",
"type": "pro",
"interval": "month",
"interval_count": 1,
"active": true,
"is_recommended": false,
"weight": 2,
"trial_period_days": 0,
"is_default": false
}
},
"plan": {
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e52",
"name": "Pro Monthly",
"price": 1000,
"currency": "usd",
"type": "pro",
"interval": "month",
"interval_count": 1,
"active": true,
"is_recommended": false,
"weight": 2,
"trial_period_days": 0,
"is_default": false
}
}
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the subscription. |
| start_at | bigint | Expresses in timestamp the day of the subscription. Should be in UNIX timestamp format. |
| end_at | bigint | Expresses in timestamp the day when the subscription should end and need to be renewed or cancelled. Should be in UNIX timestamp format. |
| canceled_at | bigint | Indicates when the client canceled the subscription. Note that client cancel today but subscriptions will end at the end of period. |
| status | string | Status of the subscription. One of: trailing, active, canceled, unpaid, canceled_due_update. |
| next_plan | array | If present, indicate the details about the next plan that will start after current one expires. |
| method_details | array | Contains the details about the default payment method of the subscription. This method will be used in the next invoice. |
| plan | Plan | Details about the plan related to the subscription. |
| last_payment | Payment | Details about the payment related to the subscription. |
Current active
Get the current active subscription for the logged user.
GET /subscriptions/active/
curl -X GET 'https://backend-staging.trincico.net/subscriptions/active' \
-H 'Content-Type: application/json'
-H 'Authorization: Bearer {{token}}'
On success
{
"id": "fa651339-3d89-4adc-9ac4-6a56ff3c7c60",
"start_at": 1697499751,
"end_at": 1700178151,
"canceled_at": null,
"status": "active",
"last_payment": {
"reference": "0e51804c-caa9-4d57-9aa6-0db4717b2e92",
"gross_amount": 1000,
"net_amount": 1000,
"fee_amount": 0,
"fee_percent": "0.00",
"details": {
"type": "card",
"brand": "visa",
"last4": "4242",
"checks": {
"cvc_check": "pass",
"address_line1_check": null,
"address_postal_code_check": null
},
"wallet": null,
"country": "US",
"funding": "credit",
"exp_year": 2024,
"networks": {
"available": [
"visa"
],
"preferred": null
},
"exp_month": 12,
"fingerprint": "CwUhIMmImN831aPl",
"generated_from": null,
"three_d_secure_usage": {
"supported": true
}
},
"currency": "usd",
"created_at": 1697499698,
"status": "completed",
"target": "subscription",
"method": "stripe",
"invoice": {},
"plan": {
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e52",
"name": "Pro Monthly",
"price": 1000,
"currency": "usd",
"type": "pro",
"interval": "month",
"interval_count": 1,
"active": true,
"is_recommended": false,
"weight": 2,
"trial_period_days": 0,
"is_default": false,
"features": [
{
"name": "action 2",
"code": "actions_2",
"max_allowed_value": 1,
"metadata": null
}
]
}
},
"plan": {
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e52",
"name": "Pro Monthly",
"price": 1000,
"currency": "usd",
"type": "pro",
"interval": "month",
"interval_count": 1,
"active": true,
"is_recommended": false,
"weight": 2,
"trial_period_days": 0,
"is_default": false,
"features": [
{
"name": "action 2",
"code": "actions_2",
"max_allowed_value": 1,
"metadata": null
}
]
}
}
Request
Authentication
Required
Body
No need
Response success
Response errors
| Code | Message |
|---|---|
| internal_error | Opps something went wrong. |
Upgrade
Upgrade from one subscription to another. Not all subscription requires payments. Upgrading from Basic to Pro, it will require payment, but once in the remote server the subscription is saved and configured, upgrading or downgrading will only cause changes in the next invoice. If user downgrade, the new plan will start at the end of current one, but user can restart the plan or resume it, this will be only possible if canceled_at field is not null.
POST /subscriptions/upgrade/
curl -X POST 'https://backend-staging.trincico.net/subscriptions/upgrade/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"plan_id": "9742d55e-4a76-4b4e-9a36-0e5162579e54",
"success_url": "https://beta.trincico.com",
"cancel_url": "https://beta.trincico.com/account"
}'
On success
{
"code": "next_plan_waiting"
}
{
"redirect_url": "https://checkout.stripe.com/c/pay/cs_test_a1P8NdLSO3xDlMz4pnpXW0pNxLBHcs263tTqdE4Ulu96z9MB2JdXkszZg1#fidkdWxOYHwnPyd1blpxYHZxWjA0S3V3Q39PY21RM3NCXTBSfDZqcTRDbFV2ZFRKNnxKPW9rPG9TUDA1blYxfHBxY2pyQVc3SXU2VHRyYlFjNVVcSmRia1Znf2FhfzI1ZkdRc25fNWJkU2hPNTUxPUYzZm12UScpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl"
}
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| plan_id | uuid | yes | The plan to which the customer wants to upgrade. |
| success_url | url | yes | The url where the customer should be redirected after success process. |
| cancel_url | url | yes | The url where the customer should be redirected after failed process. |
| payment_method_id | uuid | no | The payment method the customer prefer to use. No applicable now due only one PM. |
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 428 | redirect_url | no | Only present when payment is required. Upgrading from Basic to Pro will required payment, but upgrading from Pro to Elite will not required payment, only next invoice adjustment. |
| 200 | code | no | One of: next_plan_waiting(downgraded plan will start at the end of current one), payment_not_required(the payment difference will be calculate on next invoice), payment_required(payment its required but without user interaction. It will be deducted from payment method before next invoice). |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | missing_param | If some required param is not present in the request. |
| 400 | unrecognized_parameter | Unrecognized param is present in the request. |
| 400 | invalid_param | Some param did not pass the validation due wrong value. |
| 400 | multi_row | User have more than one active subscription. |
| 400 | already_have_resource | User already have the desired plan. |
| 404 | not_found | No plan was found with the id under plan_id param. |
| 404 | not_found | If present payment_method_id and is not found. |
| 404 | not_found | User does not have any active subscription. |
| 412 | configuration_needed | The product price for the subscription in the remote payment method was not configured yet. |
| 500 | internal_error | Opps something went wrong. |
| 503 | service_unavailable | Connection with external service (Paypal, Stripe, etc) failed. Operation can not continue. |
Cancel
Cancel the subscription. By default, all subscription canceled it will be valid til the end date.
POST /subscriptions/:id/cancel/
curl -X POST 'https://backend-staging.trincico.net/subscriptions/:id/cancel/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}'
Request
Authentication
Required
Body
No needed
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 204 | empty response | Yes | Always empty response. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 404 | not_found | No subscription id not found. |
| 400 | forbidden_resource | Sent subscription id does not belong to the logged user. |
| 400 | status_value_denied | The subscription to cancel is not in status trailing or active. |
| 400 | non_processable | The subscription id on the remote server was not on DB. |
| 503 | service_unavailable | Connection with external service (Paypal, Stripe, etc) failed. Operation can not continue. |
| 500 | internal_error | Opps something went wrong. |
Update payment method
The user may need to update the payment method used for the subscrition for few reaons like payment method not valid anymore. This process update the payment method in the remote service like PayPal, Stripe and so on. We don’t save the payment details of the customer. If the request is OK, redirect_url will be in the response, similar to the process of create, and the customer will update the method in external service.
POST /subscriptions/:id/update-payment/
curl -X POST 'https://backend-staging.trincico.net/subscriptions/22bca388-1e44-40a2-b1de-87f97576daa3/update-payment/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"success_url": "https://beta.trincico.com",
"cancel_url": "https://beta.trincico.com/account"
}'
On success
{
"redirect_url": "https://checkout.stripe.com/c/pay/cs_test_a1P8NdLSO3xDlMz4pnpXW0pNxLBHcs263tTqdE4Ulu96z9MB2JdXkszZg1#fidkdWxOYHwnPyd1blpxYHZxWjA0S3V3Q39PY21RM3NCXTBSfDZqcTRDbFV2ZFRKNnxKPW9rPG9TUDA1blYxfHBxY2pyQVc3SXU2VHRyYlFjNVVcSmRia1Znf2FhfzI1ZkdRc25fNWJkU2hPNTUxPUYzZm12UScpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl"
}
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| success_url | url | yes | The url where the customer should be redirected after success process. |
| cancel_url | url | yes | The url where the customer should be redirected after failed process. |
| payment_method_id | uuid | no | The payment method the customer prefer to use. No applicable now due only one PM. |
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 428 | redirect_url | yes | Always present. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | missing_param | If some required param is not present in the request. |
| 400 | unrecognized_parameter | Unrecognized param is present in the request. |
| 400 | invalid_param | Some param did not pass the validation due wrong value. |
| 404 | not_found | No subscription id not found. |
| 400 | forbidden_resource | Sent subscription id does not belong to the logged user. |
| 400 | non_processable | The subscription id on the remote server was not on DB. |
| 503 | service_unavailable | Connection with external service (Paypal, Stripe, etc) failed. Operation can not continue. |
| 500 | internal_error | Opps something went wrong. |
Invoices
Invoice object
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"reference": "BT001",
"amount": 2000,
"currency": "usd",
"status": "paid",
"created_at": 1697150708,
"updated_at": 1697150708,
"items": [
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "item 1",
"price": 5000,
"quantity": 2,
"description": "example item description",
"tax": null
},
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e52",
"name": "item 2",
"price": 3000,
"quantity": 2,
"description": "example item description",
"tax": null
}
],
"payer": {
"id": 73,
"first_name": null,
"last_name": null,
"selected_language": "en",
"address": "",
"city": null,
"country": null,
"state": null,
"zip_code": null,
"number_friends": 0,
"profit": "0.00",
"refer_code": null,
"nit": "",
"email": "adrian.rosalescruz7@gmail.com",
"phone": "",
"active": true,
"created_at": "2023-09-18T12:08:19.466Z",
"updated_at": "2023-09-18T16:35:00.588Z",
"roles": [
"ROLE_PRO_MONTHLY"
],
"permissions": []
},
"service": {
"id": 77,
"name": "Bar test",
"description": "Description test bar 1",
"telephone": "",
"cellphone": "+5356707915",
"email": "cabelreinosaquevedo@gmail.com",
"website": null,
"owner": {}
}
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the invoice. |
| reference | string(50) | Reference number for the current invoice. |
| amount | bigint | The amount auto calculated by server with the sum of all items. |
| currency | string | Currency in format ISO3. |
| status | string | One of: draft, ready,paid,canceled. |
| created_at | bigint | Date of invoice creation. |
| updated_at | bigint | Date of updating invoice. |
| items | Array<InvoiceItem> | List of items of current invoice. |
| customer | Customer | The customer to whom the invoice was generated. |
| service | Service | List of items of current invoice. |
Invoice list
Returns the list of invoices. Note that this endpoint is targeted for users who have services, not for regular users.
GET /invoices
curl -X GET 'https://backend-staging.trincico.net/invoices/?service_id=77' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {{token}}'
On success
{
"next_page": null,
"data": [
{
"id": "bf4c0bf6-ae0f-4c7e-90b4-44b1bb8d3a32",
"reference": "ARC011",
"tax_amount": 3050,
"sub_amount": 20000,
"amount": 23050,
"currency": "usd",
"status": "ready",
"created_at": 1703472398,
"updated_at": 1703472482,
"items": [
{
"id": "8b0154f9-4f23-4864-b10c-f66f27f57dd9",
"name": "Extra programmer",
"price": 10000,
"quantity": 2,
"tax": 15.25,
"description": "afsdfasd",
"amount": 20000,
"tax_amount": 3050
}
],
"customer": {
"id": "c62ae358-81b1-4231-8e6b-bfe73092612e",
"first_name": "Elvis",
"last_name": "Presley",
"created_at": 1693688248,
"updated_at": 1693688248,
"business_name": "Rock & Roll",
"email": "development.ros@gmail.com",
"phone": "+17866371035"
},
"service": {
"id": "f47332dc-2907-43f7-a896-77392e037fd5",
"slug_id": null,
"slug": null,
"status": "published",
"name": "test"
}
}
]
}
Request
Authentication
Required
Body
No need
Query
| Field | Type | Required | Description |
|---|---|---|---|
| service_id | string | no | The service_id by which to apply the filter. |
| limit | int | yes | How many rows will be included in the response in case that exists such limit. |
| next_page | string | no | The ID for the next page. First request do not require this params, but it will be necessary for the next requests. |
| status | string | no | Entity status in case filter by status is needed. |
| order_by | string | no | This property should be valid on Entity model. If order_by is not present, created_at DESC will be used. |
Response success
| Code | Field | Type | Always |
|---|---|---|---|
| 200 | next_page | uuid | yes |
| 200 | data | Array<Invoice> | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 404 | not_found | No service_id was found. This error does not necessarily mean that the service does not exist in the database; it could be that if it does exist, it does not belong to the logged-in user. |
| 500 | internal_error | Opps something went wrong. |
Create
POST /invoices
curl -X POST 'https://backend-staging.trincico.net/invoices/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"service_id": 77,
"service_customer_id": "84ca72b0-7c95-4e27-8673-43b97a0783bc",
"currency": "usd",
"reference": "BT0024"
}''
On success
{
"id": "a8fd8619-5b9a-4264-9508-ba553313016b",
"reference": "BT0024",
"amount": 0,
"currency": "pln",
"status": "draft",
"created_at": 1697248319.8676522,
"updated_at": 1697248319.8676524,
"items": [],
"owner": {},
"payer": {},
"service": {}
}
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| service_id | string | yes | The service for which the invoice will be created. |
| service_customer_id | uuid | yes | The client of the service to whom the invoice will be generated. |
| reference | string | yes | Unique identifier for the invoice. Uniqueness is per service, not per customer service. |
| currency | string | no | Currency in format ISO3. |
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 201 | Invoice | yes | Note that not all objects related are present in response object. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 404 | not_found | If some required param was not found on DB Or it does not belong to logged user. |
| 409 | row_exists | If reference already exists in one Invoice for the same service_id. |
| 500 | internal_error | Opps something went wrong. |
Retrieve
Retrieve specific invoice by id.
GET /invoices/:id
curl -X GET 'https://backend-staging.trincico.net/invoices/ac9188db-533d-4abb-b29a-a2f5ed448665' \
--header 'Authorization: Bearer {{token}}'
On success
{
"id": "ac9188db-533d-4abb-b29a-a2f5ed448665",
"reference": "ARC025",
"amount": 5250,
"currency": "usd",
"status": "draft",
"created_at": 1697225163,
"updated_at": 1697234115,
"items": [
{
"id": "c895658d-dc16-4502-afc2-40636fc240a9",
"name": "Extra programmer",
"price": 1500,
"quantity": 3,
"description": "item description 1",
"tax": "0.00"
},
{
"id": "4f82d779-8688-4359-8a62-eb87b9d3f660",
"name": "Extra programmer",
"price": 500,
"quantity": 1,
"description": "item description 2",
"tax": "50.00"
}
],
"payer": {},
"service": {
"id": 77,
"name": "Bar test",
"description": "Description test bar 1",
"telephone": "",
"cellphone": "+5356707915",
"email": "cabelreinosaquevedo@gmail.com",
"website": null,
"owner": {}
}
}
Request
Authentication
Required
Body
No need
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 200 | Invoice | yes | Note that not all objects related are present in response object. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 404 | not_found | If the invoice was not found or it does not belong to logged user. |
| 500 | internal_error | Opps something went wrong. |
Update
Update specific invoice. It’s not necessary to send the entire object, just the field to update. Only DRAFT status allow invoicing update.
PUT /invoices/:id
curl -X PUT 'https://backend-staging.trincico.net/invoices/:id' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"service_customer_id": "84ca72b0-7c95-4e27-8673-43b97a0783bc",
"currency": "usd",
"reference": "BT0024"
}''
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| service_customer_id | uuid | no | The client of the service to whom the invoice will be generated. |
| reference | string | no | Unique identifier for the invoice. Uniqueness is per service, not per customer service. |
| currency | string | no | Currency in format ISO3. |
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 204 | empty response | Yes | Always empty response. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | If invoice status is different to DRAFT. |
| 404 | not_found | If some of sent param was not found on DB or it does not belong to logged user. |
| 409 | row_exists | If reference was sent and already exists in one Invoice for the same service_id. |
| 500 | internal_error | Opps something went wrong. |
Update status
Update status of the invoices. Below you can find the statuses flow:
| From Status | Allowed status |
|---|---|
| draft | ready, canceled |
| ready | draft, canceled |
| canceled | no allowed any status |
| paid | no allowed any status |
PUT /invoices/:id/status
curl -X PUT 'https://backend-staging.trincico.net/invoices/:id/status' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"status": "ready"
}''
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| status | string | yes | The new status for the invoice. One of: **draft,ready, canceled ** |
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 204 | empty response | Yes | Always empty response. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | If sent status can not be take place. Example sending PAID status. |
| 400 | non_processable | If sent status was READY but invoice has not items. |
| 404 | not_found | If invoice was not found on DB or it does not belong to logged user. |
| 500 | internal_error | Opps something went wrong. |
Build reference
This endpoint returns a proposal reference for a new invoice. The generation criteria are as follows:
-> If it is the first invoice generated for that service:
- Takes the initials of the first 3 words of the service name.
- Adds 001 to the initials.
-> If previous invoices for that service already exist in the DB, then:
- It will return the existing invoice +1 if it ends in a digit.
- It will return the existing invoice plus 1 at the end if it does not end in a digit.
GET /invoices/build-reference
curl -X GET 'https://backend-staging.trincico.net/invoices/build-reference' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {{token}}'
On success
{
"reference": "BT1000"
}
Request
Authentication
Required
Body
No need
Query
| Field | Type | Required | Description |
|---|---|---|---|
| service_id | string | yes | The service_id by which to generate a invoice and generate the reference. |
Response success
| Code | Field | Always |
|---|---|---|
| 200 | reference | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 404 | not_found | No service_id was found. This error does not necessarily mean that the service does not exist in the database; it could be that if it does exist, it does not belong to the logged-in user. |
| 500 | internal_error | Opps something went wrong. |
View
Public endpoint that retrieve an invoice by id.
GET /invoices/:id/view
curl -X GET 'https://backend-staging.trincico.net/invoices/ac9188db-533d-4abb-b29a-a2f5ed448665'/view
On success
{
"id": "ac9188db-533d-4abb-b29a-a2f5ed448665",
"reference": "ARC025",
"amount": 5250,
"currency": "usd",
"status": "draft",
"created_at": 1697225163,
"updated_at": 1697234115,
"items": [
{
"id": "c895658d-dc16-4502-afc2-40636fc240a9",
"name": "Extra programmer",
"price": 1500,
"quantity": 3,
"description": "item description 1",
"tax": "0.00"
},
{
"id": "4f82d779-8688-4359-8a62-eb87b9d3f660",
"name": "Extra programmer",
"price": 500,
"quantity": 1,
"description": "item description 2",
"tax": "50.00"
}
],
"payer": {},
"service": {}
}
Request
Authentication
No need
Body
No need
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 200 | Invoice | yes | Note that not all objects related are present in response object. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 404 | not_found | If the invoice was not found or it does not belong to logged user. |
| 500 | internal_error | Opps something went wrong. |
Pay
Pay specific invoice.
POST /invoices/:id/pay
curl -X POST 'https://backend-staging.trincico.net/invoices/:id/pay' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"success_url": "https://backend-staging.trincico.net/success",
"cancel_url": "https://backend-staging.trincico.net/failed"
}''
On success
{
"redirect_url": "https://checkout.stripe.com/c/pay/cs_test_a1P8NdLSO3xDlMz4pnpXW0pNxLBHcs263tTqdE4Ulu96z9MB2JdXkszZg1#fidkdWxOYHwnPyd1blpxYHZxWjA0S3V3Q39PY21RM3NCXTBSfDZqcTRDbFV2ZFRKNnxKPW9rPG9TUDA1blYxfHBxY2pyQVc3SXU2VHRyYlFjNVVcSmRia1Znf2FhfzI1ZkdRc25fNWJkU2hPNTUxPUYzZm12UScpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl"
}
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| success_url | url | yes | The url where the customer should be redirected after success process. |
| cancel_url | url | yes | The url where the customer should be redirected after failed process. |
| payment_method_id | uuid | no | The payment method the customer prefer to use. No applicable now due only one PM. |
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 428 | redirect_url | yes | The url where the user will be redirected for the payment. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | If invoice status is different to READY. |
| 404 | not_found | If payment_method_id was sent and it was not found on DB. |
| 412 | configuration_needed | In case that payment_id was not sent, the server could not find any Payment Method with default =True. |
| 503 | service_unavailable | The communication with external service of payment method failed. |
| 500 | internal_error | Opps something went wrong. |
Add item
Create an item for specific invoice. Note that invoice should be in DRAFT status for this operation. The field amount in the invoice will be recalculated after this operation.
POST /invoices/:id/items
curl -X POST 'https://backend-staging.trincico.net/invoices/:id/items' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{ token }}' \
--data '{
"name": "Extra programmer",
"price": 500,
"quantity": 2,
"description": "item description",
"tax": "50"
}'
On success
{
"id": "35f0c253-87c4-4e89-ac75-168af1724ccf",
"name": "Extra programmer",
"price": 500,
"quantity": 2,
"description": "afsdfasd",
"tax": "50"
}
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | yes | Name for the item. |
| price | int | yes | The price for current item. The operation price*quantity will be reflected in invoice amount. |
| quantity | int | yes | How many of this item are in the invoice. The operation price*quantity will be reflected in invoice amount. |
| description | string | no | Text describing the item. |
| tax | decimal | no | Indicates the tax value in case that apply to this item. Also affect the invoice amount. |
Response success
| Code | Field | Always |
|---|---|---|
| 201 | InvoiceItem | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | If invoice status is different to DRAFT. |
| 404 | not_found | Invoice was not found on DB or it does not belong to the logged-in user. |
| 500 | internal_error | Opps something went wrong. |
Update item
Update an item for specific invoice. Note that invoice should be in DRAFT status for this operation. The field amount in the invoice will be recalculated after this operation if price, quantity or tax was modified.
PUT /invoices/:id/items/:item-id
curl -X PUT 'https://backend-staging.trincico.net/invoices/:id/items/:item-id' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{ token }}' \
--data '{
"name": "Extra programmer2",
}'
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | no | Name for the item. |
| price | int | no | The price for current item. The operation price*quantity will be reflected in invoice amount. |
| quantity | int | no | How many of this item are in the invoice. The operation price*quantity will be reflected in invoice amount. |
| description | string | no | Text describing the item. |
| tax | decimal | no | Indicates the tax value in case that apply to this item. Also affect the invoice amount. |
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 204 | empty response | Yes | Always empty response. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | If invoice status is different to DRAFT. |
| 404 | not_found | Invoice was not found on DB or it does not belong to the logged-in user. |
| 500 | internal_error | Opps something went wrong. |
Delete item
Delete an item for specific invoice. Note that invoice should be in DRAFT status for this operation. The field amount in the invoice will be recalculated after this operation.
DELETE /invoices/:id/items/:item-id
curl -X DELETE 'http://localhost:8005/invoices/:id/items/:item-id' \
--header 'Authorization: Bearer {{token}}'
Request
Authentication
Required
Body
No need
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 204 | empty response | Yes | Always empty response. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | If invoice status is different to DRAFT. |
| 404 | not_found | Invoice was not found on DB or it does not belong to the logged-in user. |
| 500 | internal_error | Opps something went wrong. |
Profile
Profile object
We need to clearly define the fields.
Logged profile
Returns the info about the logged user.
GET /profile
curl -X GET 'https://backend-staging.trincico.net/profile' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {{token}}'
On success
{
"id": "c91b2b07-5f01-4137-85d7-2eea48528059",
"roles": [
"ROLE_PRO_MONTHLY",
"ROLE_BASIC",
"ROLE_PRO_YEARLY",
"ROLE_ELITE_MONTHLY"
],
"email": "adrian.rosalescruz7@gmail.com",
"first_name": "Adrian",
"last_name": "Ros",
"avatar": "https://trincico-staging.s3.amazonaws.com/media/default_images/default_profile_avatar.png",
"refer_code": null,
"phone": "",
"services": [
{
"id": "f47332dc-2907-43f7-a896-77392e037fd5",
"slug_id": null,
"slug": null,
"status": "published",
"name": "test",
"category_id": "60782696-d9d0-44ab-928d-c3a62fe9078a",
"cover": "https://trincico-staging.s3.amazonaws.com/media/uploads/1bb7a7901bc40f460f2af11eef1ae259_zv6O7QM.jpg",
"logo": "https://trincico-staging.s3.amazonaws.com/media/uploads/1bb7a7901bc40f460f2af11eef1ae259.jpg",
"average_rating": "4.30",
"number_of_reviews": 3,
"expiration_date": "2024-07-01T01:58:54.081Z",
"expires_at": 1719799134,
"visits": [
{
"id": "3643d389-4081-4f10-8465-c80d6bca9bf4",
"created_at": 0,
"author": "27671677-8076-4e2d-a8d2-219601eb9415"
},
{
"id": "9854d3af-5242-4f98-893b-7f3f4ca5c760",
"created_at": 0,
"author": "c91b2b07-5f01-4137-85d7-2eea48528059"
},
{
"id": "c93be37f-2042-4df0-adf7-ebe85ac83871",
"created_at": 1699967331,
"author": "ca5a0261-eaab-4e0e-8951-1c2a82e790b6"
},
{
"id": "1b4ab50a-1ba0-4176-883c-bfc9bf45d00b",
"created_at": 0,
"author": "c91b2b07-5f01-4137-85d7-2eea48528059"
}
],
"city": "Warszawa",
"state": "Mazowieckie",
"country": "PL",
"zip_code": "03-994",
"open_now": true,
"followersCount": 2,
"gallery": [
{
"id": 113,
"image": "uploads/03e9310f7159643a82d8f4dbc1a7f8f3_g7xd5oJ.jpg"
},
{
"id": 112,
"image": "uploads/03e9310f7159643a82d8f4dbc1a7f8f3_g7xd5oJ.jpg"
},
{
"id": 111,
"image": "uploads/03e9310f7159643a82d8f4dbc1a7f8f3_g7xd5oJ.jpg"
}
],
"email": "adrian.rosalescruz7@gmail.com",
"cellphone": "+15197458844",
"website": "pepe",
"description": "testtestest",
"description_short": "testtesttesttest",
"address": "Ligustrowa, 03-994 Warszawa, Poland",
"placeId": "EiNMaWd1c3Ryb3dhLCAwMy05OTQgV2Fyc3phd2EsIFBvbGFuZCIuKiwKFAoSCRNDGmaT0h5HERkTGW3idRAzEhQKEgkBn4aaZsweRxH80-qIKr7wcg",
"work_schedule": [
{
"id": "255c53c5-b57a-49eb-8735-fb5efb7033cc",
"sunday": true,
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"kind": 3,
"time_segment": [
"09:00",
"10:00",
"11:00",
"12:00",
"13:00",
"15:00",
"17:00"
],
"time_windows": [
{
"from_hour": "09:00:00",
"to_hour": "17:00:00"
}
]
}
],
"lat": 52.20101289999999,
"lng": 21.1215562,
"booking": true,
"dates_by_day": 0
}
],
"favorites": [
{
"id": "f47332dc-2907-43f7-a896-77392e037fd5",
"slug_id": null,
"slug": null,
"status": "published",
"name": "test"
}
],
"reviews": [],
"address": "",
"city": null,
"state": null,
"country": null,
"zip_code": null,
"permissions": [
{
"name": "Service create",
"code": "service_get_data_to_create",
"max_allowed_value": 5,
"metadata": null
},
{
"name": "Service update",
"code": "service_get_data_to_update",
"max_allowed_value": 10,
"metadata": null
}
],
"current_subscription": {
"id": "45d2eac8-d17e-40e1-87e0-c0b58c3b69ae",
"start_at": 1704639799,
"end_at": 1707318199,
"status": "active",
"plan": {
"id": "e91da0ca-97a6-424e-81a4-be23ea0f6b76",
"name": "Elite Monthly",
"type": "elite",
"active": true
}
},
"selected_language": "en",
"created_at": 1695038899,
"updated_at": 1697046660
}
Request
Authentication
Required
Body
No need
Response success
| Code | Field | Always |
|---|---|---|
| 200 | [Profile] | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 500 | internal_error | Opps something went wrong. |
Payout
Payout object
{
"id": "3a3e749c-62d0-4df7-bd80-09faa2fba1ca",
"frequency": "on_demand",
"currency": "usd",
"status": "completed",
"payment_method_type": "stripe",
"country": "US",
"external_accounts": [
{
"id": "ba_1O1eN3R4Z3rHzPDDyfhlfpxL",
"last4": "6789",
"object": "bank_account",
"status": "new",
"account": "acct_1O1dyqR4Z3rHzPDD",
"country": "US",
"currency": "usd",
"metadata": [],
"bank_name": "STRIPE TEST BANK",
"fingerprint": "j58EI4bjx39F3VoN",
"account_type": null,
"requirements": {
"errors": [],
"past_due": [],
"currently_due": [],
"pending_verification": []
},
"routing_number": "110000000",
"account_holder_name": null,
"account_holder_type": null,
"future_requirements": {
"errors": [],
"past_due": [],
"currently_due": [],
"pending_verification": []
},
"default_for_currency": true,
"available_payout_methods": [
"standard",
"instant"
]
}
],
"created_at": 1697413462,
"updated_at": 1697413739
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the entity. |
| frequency | string | One of: auto_daily, auto_3_days, auto_7_days, on_demand. |
| currency | string | Currency in format ISO3. The currency here reflect the default currency into the externals accounts. |
| payment_method_type | string | Payment method to which belong this account. |
| status | string | One of: pending, completed, suspended, deleted. |
| country | string | Country of the account. |
| external_accounts | array | Contains the array of the external account associated to this account. Eg, this account represent the payment method account, Stripe or Paypal. And external account represent the customer bank account where move the funds from Stripe to their banks. |
| created_at | bigint | Creation date. |
| updated_at | bigint | Last update date. |
Frequency list
Returns the list of frequencies that can be used for updating the payout account. Note that frequencies are just few, but this endpoint show the list of frequencies that the logged user can use. The response will not be the same for a Pro User that Elite User.
GET /payouts/frequencies
curl -X GET 'https://backend-staging.trincico.net/payouts/frequencies' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {{token}}'
On success
[
"auto_3_days",
"auto_7_days",
"on_demand"
]
Request
Authentication
Required
Body
No need
Response success
| Code | Field | Always |
|---|---|---|
| 200 | Array | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 500 | internal_error | Opps something went wrong. |
Create account
Create an account in external service associated with the payment method. This endpoint returns and id of the created account, this id need to be used in the /enable endpoint.
POST /payouts/account
curl -X POST 'https://backend-staging.trincico.net/payouts/account' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"payment_method_id": "9742d55e-4a76-4b4e-9a36-0e5162579e51"
}'
Request
Authentication
Required
Body
No need
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 204 | empty response | yes | No data in response. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 404 | not_found | If sent payment_method_id was not found on DB Or it does not belong to logged user. |
| 409 | row_exists | If user already have and COMPLETED account in the sent payment_method_id. |
| 500 | internal_error | Opps something went wrong. |
| 503 | service_unavailable | Connection with external service (Paypal, Stripe, etc) failed. Operation can not continue. |
Enable-refresh account
This endpoint has three uses: One is related to enable a created payout account. Second one is to allow user to retry the activation account in case that failed. Third one is to allow user to change the external account associated to the payout main account. Eg, customer is using Millenium external account, and wants to payout to Paribas.
POST /payouts/account/enable
curl -X POST 'https://backend-staging.trincico.net/payouts/account/enable' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"refresh_url": "https://backend-staging.trincico.net/payouts/account/af8fb76a-fec5-4474-a519-88db23dd7e0d/enable",
"return_url": "https://backend-staging.trincico.net/success"
}'
On success
{
"redirect_url": "https://connect.stripe.com/setup/e/acct_1O1dyqR4Z3rHzPDD/QlN5tiF1DfP8"
}
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| refresh_url | string | yes | This is actually the same url that you are making the request. |
| return_url | string | yes | The url were to redirect in case of success. |
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 428 | redirect_url | yes | The url where to redirect the user to perform the payout account process in external system. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 404 | not_found | If the account id sent was not found on DB Or it does not belong to logged user. |
| 500 | internal_error | Opps something went wrong. |
| 503 | service_unavailable | Connection with external service (Paypal, Stripe, etc) failed. Operation can not continue. |
Retrieve current account
Returns a current active or pending account.
GET /payouts/account/
curl -X GET 'https://backend-staging.trincico.net/payouts/account' \
--header 'Authorization: Bearer {{token}}'
On success
{
"id": "3a3e749c-62d0-4df7-bd80-09faa2fba1ca",
"frequency": "auto_7_days",
"currency": "usd",
"status": "completed",
"country": "US",
"external_accounts": [],
"created_at": 1697413462,
"updated_at": 1697413552,
"user": {}
}
Request
Authentication
Required
Query
No need
Response success
| Code | Field | Always |
|---|---|---|
| 200 | Payout User Account | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 404 | not_found | User dont have any pending or active account. |
| 500 | internal_error | Opps something went wrong. |
Update frequency
Update the frequency for specific payout user account. Note that this endpoint is not only about DB, is also about updating the frequency in the remote payment method.
PUT /payouts/account/frequency
curl -X PUT 'https://backend-staging.trincico.net/payouts/account/frequency' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"frequency": "on_demand"
}'
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| frequency | string | yes | One of: auto_daily, auto_3_days, auto_7_days, on_demand. Note that the options to send here are from the first endpoint Frequency list |
Response success
| Code | Field | Always |
|---|---|---|
| 204 | empty response | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | In case that the frequency sent can not be performed according with the user plan. |
| 404 | not_found | If sent account_id sent was not found on DB Or it does not belong to logged user. |
| 500 | internal_error | Opps something went wrong. |
| 503 | service_unavailable | Connection with external service (Paypal, Stripe, etc) failed. Operation can not continue. |
Get balance
Returns the balance from the payout account. This endpoint is fundamental for showing the current money to the user and also before allowing the user to payout. Notice that in case of no data under the key, null value will be presented.
GET /payouts/account/balance
curl -X GET 'https://backend-staging.trincico.net/payouts/account/balance' \
--header 'Authorization: Bearer {{token}}'
On success
{
"available": [
{
"amount": 108056,
"currency": "eur"
},
{
"amount": 118109,
"currency": "pln"
}
],
"instant": null,
"pending": [
{
"amount": 104087,
"currency": "eur"
},
{
"amount": 86054,
"currency": "pln"
}
]
}
Request
Authentication
Required
Body
No need
Response success
| Code | Field | Always |
|---|---|---|
| 200 | Object | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | If the account has not status COMPLETED. |
| 404 | not_found | If the account id sent was not found on DB Or it does not belong to logged user. |
| 500 | internal_error | Opps something went wrong. |
| 503 | service_unavailable | Connection with external service (Paypal, Stripe, etc) failed. Operation can not continue. |
Get external accounts
Returns the externals account associated to the payout account. Remember external account are related to the customer user, and payout account is related to payment method account.
GET /payouts/account/external-accounts
curl -X GET 'https://backend-staging.trincico.net/payouts/account/external-accounts' \
--header 'Authorization: Bearer {{token}}'
On success
[
{
"id": "ba_1OSwUCR6ZSvi4qI4QZLbMV3y",
"object": "bank_account",
"account": "acct_1OSwSER6ZSvi4qI4",
"account_holder_name": null,
"account_holder_type": null,
"account_type": null,
"available_payout_methods": [
"standard",
"instant"
],
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"default_for_currency": true,
"fingerprint": "j58EI4bjx39F3VoN",
"future_requirements": {
"currently_due": [],
"errors": [],
"past_due": [],
"pending_verification": []
},
"last4": "6789",
"metadata": [],
"requirements": {
"currently_due": [],
"errors": [],
"past_due": [],
"pending_verification": []
},
"routing_number": "110000000",
"status": "new"
}
]
Request
Authentication
Required
Body
No need
Response success
| Code | Field | Always |
|---|---|---|
| 200 | Object | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | If the account has not status COMPLETED. |
| 404 | not_found | If the account id sent was not found on DB Or it does not belong to logged user. |
| 500 | internal_error | Opps something went wrong. |
| 503 | service_unavailable | Connection with external service (Paypal, Stripe, etc) failed. Operation can not continue. |
Create payout
Create and payout
POST /payouts
curl -X POST 'https://backend-staging.trincico.net/payouts' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '{
"payout_account_id": "9eac9fbc-4050-458c-af0c-45f750473439",
"currency": "usd",
"amount": 7000,
"instant": true
}'
Request
Authentication
Required
Body
| Field | Type | Required | Description |
|---|---|---|---|
| currency | string | yes | The payout currency. |
| amount | bigint | yes | The payout amount. |
| instant | bool | yes | Specify if the payout will be instant or not. In case is not instant the payout will take place at the end of day like each bank schedule time. |
Response success
| Code | Field | Always |
|---|---|---|
| 204 | empty response | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | If the frequency of the sent account is not on_demand. |
| 400 | balance_insufficient | If the user account has not enough funds for the desired amount. |
| 404 | not_found | If sent payment_method_id was not found on DB Or it does not belong to logged user. |
| 500 | internal_error | Opps something went wrong. |
| 503 | service_unavailable | Connection with external service (Paypal, Stripe, etc) failed. Operation can not continue. |
List payouts
Returns a list of payouts from logged users.
GET /payouts
curl -X GET 'http://backend-staging.trincico.net/payouts?limit=2&cursor=0d492884-d43a-4766-886b-dbad0f2629a1&status=paid' \
--header 'Authorization: Bearer {{token}}'
On success
{
"next_page": "66297bd8-0127-473d-87fb-e71f6dfd098c",
"limit": 2,
"data": [
{
"id": "487f1eff-adbb-4c95-952a-96046b20b005",
"status": "paid",
"amount": 2000,
"currency": "usd",
"arrival_date": 1703944607,
"automatic": false,
"sent_method": "instant",
"type": "bank_account",
"description": null,
"created_at": 1703944609,
"updated_at": 1703944609,
"destination_account": {
"id": "9eac9fbc-4050-458c-af0c-45f750473439",
"frequency": "on_demand",
"currency": "usd",
"status": "completed",
"country": "US",
"external_accounts": [
{
"id": "ba_1OSwUCR6ZSvi4qI4QZLbMV3y",
"last4": "6789",
"object": "bank_account",
"status": "new",
"account": "acct_1OSwSER6ZSvi4qI4",
"country": "US",
"currency": "usd",
"metadata": [],
"bank_name": "STRIPE TEST BANK",
"fingerprint": "j58EI4bjx39F3VoN",
"account_type": null,
"requirements": {
"errors": [],
"past_due": [],
"currently_due": [],
"pending_verification": []
},
"routing_number": "110000000",
"account_holder_name": null,
"account_holder_type": null,
"future_requirements": {
"errors": [],
"past_due": [],
"currently_due": [],
"pending_verification": []
},
"default_for_currency": true,
"available_payout_methods": [
"standard",
"instant"
]
}
],
"created_at": 1703919332,
"updated_at": 1703922995,
"user": null
},
"user": {
"id": 193,
"first_name": null,
"avatar": "",
"last_name": null,
"selected_language": "en",
"address": "",
"city": null,
"country": null,
"state": null,
"zip_code": null,
"number_friends": 0,
"profit": "0.00",
"refer_code": null,
"nit": "",
"email": "development.ros@gmail.com",
"phone": "",
"active": true,
"created_at": 0,
"updated_at": 0,
"roles": [
"ROLE_BASIC",
"ROLE_PRO_MONTHLY",
"ROLE_PRO_YEARLY",
"ROLE_ELITE_MONTHLY"
],
"permissions": []
}
},
{
"id": "f207bf8f-05fb-41a5-94b7-236ec7b1fa9d",
"status": "paid",
"amount": 2000,
"currency": "usd",
"arrival_date": 1703944243,
"automatic": false,
"sent_method": "instant",
"type": "bank_account",
"description": null,
"created_at": 1703944244,
"updated_at": 1703944244,
"destination_account": {
"id": "9eac9fbc-4050-458c-af0c-45f750473439",
"frequency": "on_demand",
"currency": "usd",
"status": "completed",
"country": "US",
"external_accounts": [
{
"id": "ba_1OSwUCR6ZSvi4qI4QZLbMV3y",
"last4": "6789",
"object": "bank_account",
"status": "new",
"account": "acct_1OSwSER6ZSvi4qI4",
"country": "US",
"currency": "usd",
"metadata": [],
"bank_name": "STRIPE TEST BANK",
"fingerprint": "j58EI4bjx39F3VoN",
"account_type": null,
"requirements": {
"errors": [],
"past_due": [],
"currently_due": [],
"pending_verification": []
},
"routing_number": "110000000",
"account_holder_name": null,
"account_holder_type": null,
"future_requirements": {
"errors": [],
"past_due": [],
"currently_due": [],
"pending_verification": []
},
"default_for_currency": true,
"available_payout_methods": [
"standard",
"instant"
]
}
],
"created_at": 1703919332,
"updated_at": 1703922995,
"user": null
},
"user": {
"id": 193,
"first_name": null,
"avatar": "",
"last_name": null,
"selected_language": "en",
"address": "",
"city": null,
"country": null,
"state": null,
"zip_code": null,
"number_friends": 0,
"profit": "0.00",
"refer_code": null,
"nit": "",
"email": "development.ros@gmail.com",
"phone": "",
"active": true,
"created_at": 0,
"updated_at": 0,
"roles": [
"ROLE_BASIC",
"ROLE_PRO_MONTHLY",
"ROLE_PRO_YEARLY",
"ROLE_ELITE_MONTHLY"
],
"permissions": []
}
}
]
}
Request
Authentication
Required
Query
| Field | Type | Required | Description |
|---|---|---|---|
| limit | int | yes | How many rows will be included in the response in case that exists such limit. |
| next_page | string | no | The ID for the next page. First request do not require this params, but it will be necessary for the next requests. |
| status | string | no | Entity status in case filter by status is needed. |
| order_by | string | no | This property should be valid on Entity model. If order_by is not present, created_at DESC will be used. |
Response success
| Code | Field | Type | Always |
|---|---|---|---|
| 200 | next_page | uuid | yes |
| 200 | data | Array<Payout> | yes |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 500 | internal_error | Opps something went wrong. |
Notifications
Send notification
Requests to API to send specific notifications according to channels.
GET /notifications/send
curl X GET 'https://backend-staging.trincico.net/notifications/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {{ base64_encode(:api_password) }}' \
--data '{
"channel": "email_notification",
"scope": "invoice_created",
"target_id": "c3005c66-7cfa-4e8e-b556-f4605caad987"
}'
Request
Authentications
Required
Basic auth is required. Only the password is required in base64 encoded. The password is hardcoded password.
Body
| Field | Type | Required | Description |
|---|---|---|---|
| channel | string | yes | The channel that will be used for sending the notification. One of: email_notification,sms_notification. |
| scope | string<Scope> | yes | Specify the scope or the action that should be notified. Scope list change according to the channel. |
| target_id | string | yes | The id of the entity involved in the process. Eg, for Welcome email, the profile id is used; for invoices notifications, the invoice id is used, for payments notifications, the payment id is used. . |
Response success
| Code | Field | Always | Description |
|---|---|---|---|
| 204 | empty response | Yes | Always empty response. |
Response errors
| Http Code | Code | Message |
|---|---|---|
| 400 | status_value_denied | Only invoices with status READY can be share with the customer. |
| 404 | not_found | There is not handler for requested scope. |
| 412 | status_value_denied | User has not activation code generated. |
| 500 | internal_error | Opps something went wrong. |
| 501 | not_implemented | This functionality is not yet implemented. |
Notification channels
Email notification scopes
List of all possible scopes that can be sent with the channel email_notification
| Key | Description |
|---|---|
| welcome | Send welcome email and include the initial email verification. |
| email_verification | Send email verification code in case that welcome email did not arrived. |
| request_password_code | Send verification code for reset password request. |
| password_updated | Inform to user that password was updated. |
| invoice_created | Notify to customer that service provider issue an invoice. |
| invoice_paid | Send email to invoice payer for confirming invoice paid. |
| booking_created | Notify to Service owner that new booking was requested and is waiting for confirmation. |
| booking_owner_canceled | Notify to user that service owner has canceled the booking. |
| booking_user_canceled | Notify to owner that user has canceled the booking. |
| booking_approved | Notify to user that service owner has approved the booking. |
| subscription_updated | Notify to user that subscription was updated. |
| subscription_canceled | Notify to user that subscription was canceled. |
| payout_updated | Notify to user that requested payout was updated. |
Sms notification scopes
List of all possible scopes that can be sent with the channel sms_notification
| Key | Description |
|---|---|
| NO IMPLEMENTED YET | NO IMPLEMENTED YET |
Data Transfer Objects
PaymentMethod
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "Stripe",
"payout_enable": true,
"is_default": true
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the payment method. |
| type | string | One of: stripe. |
| payout_enabled | boolean | Indicates whether the payout is enabled. |
| is_default | boolean | Indicates whether this method is the default. Only one default method is allowed. |
Permission
{
"name": "action 1",
"code": "action_1",
"max_allowed_value": 3,
"metadata": null
}
| Attribute | Type | Description |
|---|---|---|
| name | string | Name of the permission. |
| code | string | A unique code for the action involved. |
| max_allowed_value | integer | For actions handling numeric items, this expresses the max allowed value. |
| metadata | string | Extra data, applicable in some cases. |
Plan
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "Basic",
"price": 0,
"currency": "usd",
"interval": "year",
"interval_count": 1,
"active": true,
"is_recommended": false,
"weight": 1,
"trial_period_days": 0,
"is_default": true
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the plan. |
| name | string(30) | Name of the plan. |
| price | bigint | The amount a user should pay to subscribe to this plan. |
| currency | string | Currency in which user will pay in this plan. Maximum length is 3. |
| interval | string | One of: month, year. |
| interval_count | int | Indicates the counter for inteval. |
| active | bool | Indicates whether the plan is active or not. |
| is_recommended | bool | Indicate if the plan is recommended. Only one plan can be recommended. |
| weight | int | The order of priority of the plan. Indicates if one plan is superior to another. |
| trial_period_days | int | If the plan includes trial days, expresses the number in days. |
| is_default | bool | Whether the plan is the default one or not. Only one plan can be default. |
Subscription
{
"data": {
"id": "412e598e-ee20-4946-8cb7-4ded0b33019e",
"start_at": 1697815942,
"end_at": 1700494342,
"canceled_at": null,
"method_details": {
"type": "card",
"brand": "mastercard",
"last4": "4444",
"checks": {
"cvc_check": "pass",
"address_line1_check": null,
"address_postal_code_check": null
},
"wallet": null,
"country": "US",
"funding": "credit",
"exp_year": 2024,
"networks": {
"available": [
"mastercard"
],
"preferred": null
},
"exp_month": 12,
"fingerprint": "IKMS1UJn8dAWCt39",
"generated_from": null,
"three_d_secure_usage": {
"supported": true
}
},
"next_plan": null,
"status": "active",
"last_payment": {
"id": "4bf68f6e-57c5-4a22-b4a2-0affee2884f0",
"reference": "815884",
"gross_amount": 1000,
"net_amount": 1000,
"fee_amount": 0,
"fee_percent": "0.00",
"details": {
"type": "card",
"brand": "visa",
"last4": "4242",
"checks": {
"cvc_check": "pass",
"address_line1_check": null,
"address_postal_code_check": null
},
"wallet": null,
"country": "US",
"funding": "credit",
"exp_year": 2024,
"networks": {
"available": [
"visa"
],
"preferred": null
},
"exp_month": 12,
"fingerprint": "CwUhIMmImN831aPl",
"generated_from": null,
"three_d_secure_usage": {
"supported": true
}
},
"currency": "usd",
"created_at": 1697815881,
"status": "completed",
"target": "subscription",
"method": "stripe",
"invoice": {},
"plan": {
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e52",
"name": "Pro Monthly",
"price": 1000,
"currency": "usd",
"type": "pro",
"interval": "month",
"interval_count": 1,
"active": true,
"is_recommended": false,
"weight": 2,
"trial_period_days": 0,
"is_default": false
}
},
"plan": {
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e52",
"name": "Pro Monthly",
"price": 1000,
"currency": "usd",
"type": "pro",
"interval": "month",
"interval_count": 1,
"active": true,
"is_recommended": false,
"weight": 2,
"trial_period_days": 0,
"is_default": false
}
}
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the subscription. |
| start_at | bigint | Expresses in timestamp the day of the subscription. Should be in UNIX timestamp format. |
| end_at | bigint | Expresses in timestamp the day when the subscription should end and need to be renewed or cancelled. Should be in UNIX timestamp format. |
| canceled_at | bigint | Indicates when the client canceled the subscription. Note that client cancel today but subscriptions will end at the end of period. |
| status | string | Status of the subscription. One of: trailing, active, canceled, unpaid, canceled_due_update. |
| next_plan | array | If present, indicate the details about the next plan that will start after current one expires. |
| method_details | array | Contains the details about the default payment method of the subscription. This method will be used in the next invoice. |
| plan | Plan | Details about the plan related to the subscription. |
| last_payment | Payment | Details about the payment related to the subscription. |
Invoice
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"reference": "BT001",
"amount": 2000,
"currency": "usd",
"status": "paid",
"created_at": 1697150708,
"updated_at": 1697150708,
"items": [
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "item 1",
"price": 5000,
"quantity": 2,
"description": "example item description",
"tax": null
},
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e52",
"name": "item 2",
"price": 3000,
"quantity": 2,
"description": "example item description",
"tax": null
}
],
"payer": {
"id": 73,
"first_name": null,
"last_name": null,
"selected_language": "en",
"address": "",
"city": null,
"country": null,
"state": null,
"zip_code": null,
"number_friends": 0,
"profit": "0.00",
"refer_code": null,
"nit": "",
"email": "adrian.rosalescruz7@gmail.com",
"phone": "",
"active": true,
"created_at": "2023-09-18T12:08:19.466Z",
"updated_at": "2023-09-18T16:35:00.588Z",
"roles": [
"ROLE_PRO_MONTHLY"
],
"permissions": []
},
"service": {
"id": 77,
"name": "Bar test",
"description": "Description test bar 1",
"telephone": "",
"cellphone": "+5356707915",
"email": "cabelreinosaquevedo@gmail.com",
"website": null,
"owner": {}
}
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the invoice. |
| reference | string(50) | Reference number for the current invoice. |
| amount | bigint | The amount auto calculated by server with the sum of all items. |
| currency | string | Currency in format ISO3. |
| status | string | One of: draft, ready,paid,canceled. |
| created_at | bigint | Date of invoice creation. |
| updated_at | bigint | Date of updating invoice. |
| items | Array<InvoiceItem> | List of items of current invoice. |
| customer | Customer | The customer to whom the invoice was generated. |
| service | Service | List of items of current invoice. |
Invoice Item
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "item 1",
"price": 123,
"quantity": 2,
"description": "example description about this item.",
"tax": null
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the item. |
| name | string(30) | Name of the item. |
| price | bigint | The price for current item. |
| quantity | int | How many of this item are in the invoice. |
| description | string | Text describing the item. |
| tax | double | Indicates the tax value in case that apply to this item. |
User
{
"id": 73,
"first_name": null,
"last_name": null,
"selected_language": "en",
"address": "",
"city": null,
"country": null,
"state": null,
"zip_code": null,
"number_friends": 0,
"profit": "0.00",
"refer_code": null,
"nit": "",
"email": "adrian.rosalescruz7@gmail.com",
"phone": "",
"active": true,
"created_at": "2023-09-18T12:08:19.466Z",
"updated_at": "2023-09-18T16:35:00.588Z",
"roles": [
"ROLE_PRO_MONTHLY"
],
"permissions": []
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the invoice. |
| first_name | string | First name for user. |
| last_name | string | Last name for user. |
| selected_language | string | Current language of user. |
| address | string | Address of user. |
| city | string | City of user. |
| country | string | Country of user. |
| state | string | State of user. |
| zip_code | string | Zip code of user. |
| number_friends | int | Number of friends. |
| profit | decimal | The money accumulated. |
| refer_code | string | The invite code of the user. |
| nit | string | Nit of the user. |
| string | Email of the user. | |
| phone | string | Phone of the user. |
| active | bool | Indicate if user is active or not. |
| created_at | bigint | Date of user creation. |
| updated_at | bigint | Date of updating user. |
| roles | Array<String> | The list contains not the role object but the code of the role. |
| permissions | Array<Permission> | List of permissions of current user. |
Service
{
"id": 77,
"name": "Bar test",
"description": "Description test bar 1",
"telephone": "",
"cellphone": "+5356707915",
"email": "cabelreinosaquevedo@gmail.com",
"website": null,
"owner": {}
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the invoice. |
| slug_id | string | Service slug. @deprecated in favor of slug |
| slug | string | Service slug. |
| status | string | One of: created, published, unpublished, suspended |
| name | string | Name of the service. |
| category_id | string | The id of category. |
| cover | string | Cover img url. |
| logo | string | Logo img url. |
| average_rating | string | Average rating. |
| number_of_reviews | string | Number of review of service. |
| expiration_date | string | The expiration date. @deprecated in favor of expires_at |
| expires_at | string | The expiration date. |
| visits | array | List of visit objets. |
| description | string | Description of the service. |
| telephone | string | Phone of the service. |
| cellphone | string | Mobile number of the service. |
| website | string | Website url of the service. |
| expiration_date(@deprecated) | datetime | Datetime with the expiration date. |
| expires_at | bigint | Bigint with the expiration date. |
| owner | User | The user who own the service. |
Payment
{
"id": "0e51804c-caa9-4d57-9aa6-0db4717b2e92",
"reference": "0e51804c-caa9-4d57-9aa6-0db4717b2e92",
"gross_amount": 1000,
"net_amount": 1000,
"fee_amount": 0,
"fee_percent": "0.00",
"details": {
"type": "card",
"brand": "visa",
"last4": "4242",
"checks": {
"cvc_check": "pass",
"address_line1_check": null,
"address_postal_code_check": null
},
"wallet": null,
"country": "US",
"funding": "credit",
"exp_year": 2024,
"networks": {
"available": [
"visa"
],
"preferred": null
},
"exp_month": 12,
"fingerprint": "CwUhIMmImN831aPl",
"generated_from": null,
"three_d_secure_usage": {
"supported": true
}
},
"currency": "usd",
"created_at": 1697499698,
"status": "completed",
"target": "subscription",
"method": "stripe",
"invoice": {},
"plan": {
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e52",
"name": "Pro Monthly",
"price": 1000,
"currency": "usd",
"type": "pro",
"interval": "month",
"interval_count": 1,
"active": true,
"is_recommended": false,
"weight": 2,
"trial_period_days": 0,
"is_default": false,
"features": [
{
"name": "action 2",
"code": "actions_2",
"max_allowed_value": 1,
"metadata": null
}
]
}
}
| Attribute | Type | Description |
|---|---|---|
| reference | uuid | Unique identifier for the payment. |
| gross_amount | bigint | The amount before fees. |
| net_amount | bigint | Amount after fees. |
| fee_amount | bigint | Fee amount applied. |
| fee_percent | decimal | Fee percent applied. |
| currency | string | Currency in format ISO3. |
| details | json | Details about the method used for the payment. |
| created_at | bigint | Date of payment creation. |
| status | string | One of: pending, completed, refunded,failed. |
| target | string | One of: subscription, invoice. |
| method | string | Payment method used for the payment. Note this is not about card, this is more about Stripe, Paypal, etc. |
| invoice | Invoice | If payment was for target invoice: the involed paid. |
| plan | Plan | If payment was for target subscription: the plan involved. |
Payout User Account
{
"id": "3a3e749c-62d0-4df7-bd80-09faa2fba1ca",
"frequency": "on_demand",
"currency": "usd",
"status": "completed",
"payment_method_type": "stripe",
"country": "US",
"external_accounts": [
{
"id": "ba_1O1eN3R4Z3rHzPDDyfhlfpxL",
"last4": "6789",
"object": "bank_account",
"status": "new",
"account": "acct_1O1dyqR4Z3rHzPDD",
"country": "US",
"currency": "usd",
"metadata": [],
"bank_name": "STRIPE TEST BANK",
"fingerprint": "j58EI4bjx39F3VoN",
"account_type": null,
"requirements": {
"errors": [],
"past_due": [],
"currently_due": [],
"pending_verification": []
},
"routing_number": "110000000",
"account_holder_name": null,
"account_holder_type": null,
"future_requirements": {
"errors": [],
"past_due": [],
"currently_due": [],
"pending_verification": []
},
"default_for_currency": true,
"available_payout_methods": [
"standard",
"instant"
]
}
],
"created_at": 1697413462,
"updated_at": 1697413739
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the entity. |
| frequency | string | One of: auto_daily, auto_3_days, auto_7_days, on_demand. |
| currency | string | Currency in format ISO3. The currency here reflect the default currency into the externals accounts. |
| payment_method_type | string | Payment method to which belong this account. |
| status | string | One of: pending, completed, suspended, deleted. |
| country | string | Country of the account. |
| external_accounts | array | Contains the array of the external account associated to this account. Eg, this account represent the payment method account, Stripe or Paypal. And external account represent the customer bank account where move the funds from Stripe to their banks. |
| created_at | bigint | Creation date. |
| updated_at | bigint | Last update date. |
Payout
{
"id": "9f722642-a59a-4d20-b821-3eb91f93dbe5",
"status": "paid",
"amount": 7000,
"currency": "usd",
"arrival_date": "1697413777",
"automatic": false,
"sent_method": "instant",
"type": "bank_account",
"description": "example description",
"created_at": 1697413778,
"updated_at": 1697413778,
"destination_account": {
"id": "3a3e749c-62d0-4df7-bd80-09faa2fba1ca",
"frequency": "on_demand",
"currency": "usd",
"status": "completed",
"country": "US",
"external_accounts": [
{
"id": "ba_1O1eN3R4Z3rHzPDDyfhlfpxL",
"last4": "6789",
"object": "bank_account",
"status": "new",
"account": "acct_1O1dyqR4Z3rHzPDD",
"country": "US",
"currency": "usd",
"metadata": [],
"bank_name": "STRIPE TEST BANK",
"fingerprint": "j58EI4bjx39F3VoN",
"account_type": null,
"requirements": {
"errors": [],
"past_due": [],
"currently_due": [],
"pending_verification": []
},
"routing_number": "110000000",
"account_holder_name": null,
"account_holder_type": null,
"future_requirements": {
"errors": [],
"past_due": [],
"currently_due": [],
"pending_verification": []
},
"default_for_currency": true,
"available_payout_methods": [
"standard",
"instant"
]
}
],
"created_at": 1697413462,
"updated_at": 1697413739
},
"user": {
"id": 73,
"first_name": "Test first name",
"last_name": "Test last name",
"selected_language": "en",
"address": "",
"city": null,
"country": null,
"state": null,
"zip_code": null,
"number_friends": 0,
"profit": "0.00",
"refer_code": null,
"nit": "",
"email": "adrian.rosalescruz7@gmail.com",
"phone": "",
"active": true,
"created_at": "2023-09-18T12:08:19.466Z",
"updated_at": "2023-09-18T16:35:00.588Z",
"roles": [
"ROLE_PRO_MONTHLY"
],
"permissions": []
}
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the invoice. |
| status | string | One of: pending, in_transit, paid, canceled, failed, requested. |
| amount | bigint | Payout amount. |
| currency | string | Currency in format ISO3. |
| arrival_date | bigint | Arrival data of payout. |
| automatic | bool | If payout was automatic or not. |
| sent_method | string | The method used for sending the payout. One of: standard, instant |
| type | string | The type of destination customer used for the payout. One of: bank_account, card. |
| description | string | Description about the payout. |
| created_at | bigint | Date of user creation. |
| updated_at | bigint | Date of updating user. |
| destination_account | Payout User Account | Destination account where the funds were sent. |
| user | User | Our system user whom request the payout. |
Customer
{
"id": "84ca72b0-7c95-4e27-8673-43b97a0783bc",
"first_name": "Crispin",
"last_name": "Gatieza",
"business_name": "Blue pill",
"email": "bluepill@gmail.com",
"phone": "+5352524455",
"created_at": 1693688431,
"updated_at": 1693688431,
"service": {
"id": 77,
"name": "Bar test",
"description": "Description test bar 1",
"telephone": "",
"cellphone": "+5356707915",
"email": "cabelreinosaquevedo@gmail.com",
"website": null,
"address": "Buenos Aires, Córdoba, Argentina",
"city": "Córdoba",
"zip_code": null,
"owner": null
}
}
| Attribute | Type | Description |
|---|---|---|
| id | uuid | Unique identifier for the customer. |
| first_name | string | First name of the customer. |
| last_name | string | Last name for customer. |
| business_name | string | Business name for customer. |
| string | Email of the customer. | |
| phone | string | Phone of the customer. |
| created_at | bigint | Date of customer creation. |
| updated_at | bigint | Date of updating customer. |
| service | Service | Service where the customer belong to. |
Errors list
Describe all possibles api internal errors.
| Key | Description |
|---|---|
| invalid_token | The token is invalid. |
| require_activation | The activation of the resource is mandatory. |
| bad_credentials | Invalid credentials. |
| not_found | Resource not found. |
| already_have_resource | The target entity already has the resource. |
| multi_row | The target entity has more than one object. |
| configuration_needed | Configuration is needed on server side that denied the request. |
| missing_param | Required param was not present in the request. |
| forbidden_empty_request | No params was sent to endpoint that requires at least one parameter. |
| unrecognized_parameter | Request contains a parameter that is not in the list of expected ones. |
| invalid_param | Params is expected by request, but the value is not valid. |
| status_value_denied | The resource has wrong status for the operation. Eg, cancel subscription no active. |
| service_unavailable | The endpoint depends of external services who failed. |
| forbidden_resource | Request denied due lack of permission. Eg, cancel a subscription that does not belong to the logged user. |
| non_upgradable | Resource can not be change from one status to another due limitations. Eg, upgrade to Basic subscription. |
| non_processable | Resource can not be process due mandatory params is not presend on DB row. |
| row_exists | Already exits a row with tha value. Normally reflect a conflict. |
| internal_error | Unexpected error occurs |
Response and Routes
Api has two kind of responses, one for success response and another for error response.
Success response
[
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "Stripe",
"payout_enable": true,
"is_default": true
}
]
{
"id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
"name": "Stripe",
"payout_enable": true,
"is_default": true
}
| Attribute | Description |
|---|---|
| data | Can be array or object. |
Error response
{
"internal_code": "not_found",
"message": "Resource not found.",
"field": "subscription_id"
}
| Name | Value | Description |
|---|---|---|
| code | string | Internal API code response. |
| message | string | Description for the internal internal_code code response. |
| field | array | Specify the field with error. This attribute can be empty if not neccessary |
For full details about api codes errors see error list
Routes
[
{
"name": "Account reset complete",
"code": "password_reset_complete",
"path": "/accounts/reset/done"
},
{
"name": "Activate account",
"code": "activate_account",
"path": "/activate_account"
},
{
"name": "Activate account code",
"code": "activate_account_code",
"path": "/reset_password_code"
},
{
"name": "App version",
"code": "get_version",
"path": "/getVersion"
},
{
"name": "Blog entry list",
"code": "blogentry-list",
"path": "/blog"
},
{
"name": "Category list",
"code": "category-list",
"path": "/categories"
},
{
"name": "Change language",
"code": "change_languaje",
"path": "/change_languaje"
},
{
"name": "Chat",
"code": "chat",
"path": "/chat/<str:pk>"
},
{
"name": "Chat create",
"code": "create_chat",
"path": "/chat/create"
},
{
"name": "Chat delete",
"code": "delete_chat",
"path": "/chat/<str:pk>/delete"
},
{
"name": "Chat details",
"code": "chat_details",
"path": "/chat/details/<str:pk>"
},
{
"name": "Chat send message",
"code": "send_message",
"path": "/chat_messages/create"
},
{
"name": "Chat Service owner",
"code": "service_owner",
"path": "/chat/serviceOwner"
},
{
"name": "Chat unread messages",
"code": "unread_messages",
"path": "/chat/unreadMessages/<str:pk>"
},
{
"name": "City get",
"code": "city-getCity",
"path": "/cities/getCity"
},
{
"name": "City list",
"code": "city-list",
"path": "/cities"
},
{
"name": "Country list",
"code": "country-list",
"path": "/countries"
},
{
"name": "Get Data",
"code": "get_data",
"path": "/get_data"
},
{
"name": "Invoice add item",
"code": "add_item_invoice",
"path": "/invoices/<uuid:invoice_id>/items"
},
{
"name": "Invoice list or create",
"code": "list_or_create_invoice",
"path": "/invoices"
},
{
"name": "Invoice pay",
"code": "pay_invoice",
"path": "/invoices/<uuid:invoice_id>/pay"
},
{
"name": "Invoices Build reference",
"code": "build_reference_invoice",
"path": "/invoices/build-reference"
},
{
"name": "Invoices retrieve or update",
"code": "retrieve_or_update_invoice",
"path": "/invoices/<uuid:invoice_id>"
},
{
"name": "Invoices Update status",
"code": "update_status_invoice",
"path": "/invoices/<uuid:invoice_id>/status"
},
{
"name": "Invoices View",
"code": "view_invoice",
"path": "/invoices/<uuid:invoice_id>/view"
},
{
"name": "Invoice update or delete item",
"code": "update_or_delete_item_invoice",
"path": "/invoices/<uuid:invoice_id>/items/<uuid:item_id>"
},
{
"name": "Live chat index",
"code": "index",
"path": "/livechat"
},
{
"name": "Live chat room",
"code": "room",
"path": "/livechat/<str:room_name>"
},
{
"name": "Login",
"code": "user-login",
"path": "/users/login"
},
{
"name": "Logout",
"code": "logout",
"path": "/accounts/logout"
},
{
"name": "Maintenance",
"code": "maintenance",
"path": "/maintenance"
},
{
"name": "Message Received",
"code": "message_received",
"path": "/messageReceived"
},
{
"name": "Municipality list",
"code": "municipality-list",
"path": "/municipalities"
},
{
"name": "Password change",
"code": "password_change",
"path": "/accounts/password_change"
},
{
"name": "Password change done",
"code": "password_change_done",
"path": "/accounts/password_change/done"
},
{
"name": "Password reset",
"code": "password_reset",
"path": "/accounts/password_reset"
},
{
"name": "Password reset confirm",
"code": "password_reset_confirm",
"path": "/accounts/reset/<uidb64>/<token>"
},
{
"name": "Password reset done",
"code": "password_reset_done",
"path": "/accounts/password_reset/done"
},
{
"name": "Payment complete",
"code": "payment-complete",
"path": "/payments/complete"
},
{
"name": "Payment details",
"code": "payment-detail",
"path": "/payments/<pk>"
},
{
"name": "Payment list",
"code": "payment-list",
"path": "/payments"
},
{
"name": "Payment method list",
"code": "list_payment_method",
"path": "/payment-methods"
},
{
"name": "Payout account balance",
"code": "get_account_balance_payout",
"path": "/payouts/account/<uuid:account_id>/balance"
},
{
"name": "Payout account enable",
"code": "enable_account_payout",
"path": "/payouts/account/<uuid:account_id>/enable"
},
{
"name": "Payout account frequency",
"code": "update_account_frequency_payou",
"path": "/payouts/account/<uuid:account_id>/frequency"
},
{
"name": "Payout Account get or create",
"code": "retrieve_or_create_payout",
"path": "/payouts/account"
},
{
"name": "Payout create",
"code": "create_payout",
"path": "/payouts/<uuid:account_id>"
},
{
"name": "Payout external accounts list",
"code": "external_accounts_payout",
"path": "/payouts/account/<uuid:account_id>/external-accoun"
},
{
"name": "Payout frequency list",
"code": "frequency_list_payout",
"path": "/payouts/frequencies"
},
{
"name": "Plan list",
"code": "list_plan",
"path": "/plans"
},
{
"name": "Profile block user",
"code": "block_user",
"path": "/profile/block_user"
},
{
"name": "Profile Booking Availability",
"code": "profile-booking-availability",
"path": "/profiles/<pk>/booking_availability"
},
{
"name": "Profile code friends",
"code": "profile-code-friends",
"path": "/profiles/code_friends"
},
{
"name": "Profile Details",
"code": "profile-detail",
"path": "/profiles/<pk>"
},
{
"name": "Profile info",
"code": "profile-profile-info",
"path": "/profiles/profile_info"
},
{
"name": "Profile list",
"code": "profile-list",
"path": "/profiles"
},
{
"name": "Profile location",
"code": "profile-location",
"path": "/profiles/location"
},
{
"name": "Profile notification delete",
"code": "profile-delete",
"path": "/profiles/notifications/delete"
},
{
"name": "Profile notifications",
"code": "profile-notifications",
"path": "/profiles/notifications"
},
{
"name": "Profile report",
"code": "profile-report",
"path": "/profiles/<pk>/report"
},
{
"name": "Profile reserves",
"code": "profile-reserves",
"path": "/profiles/reserves"
},
{
"name": "Profile reserves submitted",
"code": "profile-reserves-submitted",
"path": "/profiles/reserves/submitted"
},
{
"name": "Profile retrieve",
"code": "retrieve_profile",
"path": "/profile"
},
{
"name": "Profile reviews",
"code": "profile-reviews",
"path": "/profiles/reviews"
},
{
"name": "Profile seen",
"code": "profile-seen",
"path": "/profiles/notifications/seen"
},
{
"name": "Pusher auth",
"code": "pusher_auth",
"path": "/pusher/auth"
},
{
"name": "Report details list",
"code": "reportdetail-list",
"path": "/report_details"
},
{
"name": "Resend code",
"code": "resendCode",
"path": "/resendCode"
},
{
"name": "Resend code email",
"code": "resendCode_Email",
"path": "/resendCode_Email"
},
{
"name": "Resend code email password",
"code": "resendCode_Email_Password",
"path": "/resendCode_Email_Password"
},
{
"name": "Reserve accept",
"code": "reserve-accept",
"path": "/reserves/<pk>/accept"
},
{
"name": "Reserve cancel",
"code": "reserve-cancel",
"path": "/reserves/<pk>/cancel"
},
{
"name": "Reserve details",
"code": "reserve-detail",
"path": "/reserves/<pk>"
},
{
"name": "Reserve list",
"code": "reserve-list",
"path": "/reserves"
},
{
"name": "Reset Password check token",
"code": "check_reset_password_token",
"path": "/check_reset_password_token/<str:uidb64>/<str:toke"
},
{
"name": "Review answer",
"code": "review-answer",
"path": "/reviews/<pk>/answer"
},
{
"name": "Review destroy review",
"code": "review-destroy-review",
"path": "/reviews/<pk>/delete"
},
{
"name": "Review details",
"code": "review-detail",
"path": "/reviews/<pk>"
},
{
"name": "Review edit answer",
"code": "review-edit-answer",
"path": "/reviews/edit_answer"
},
{
"name": "Review report",
"code": "review-report",
"path": "/reviews/<pk>/report"
},
{
"name": "Review update",
"code": "review-updated-review",
"path": "/reviews/<pk>/update"
},
{
"name": "Rsend code password",
"code": "resendCode_Password",
"path": "/resendCode_Password"
},
{
"name": "Service add follower",
"code": "service-add-follower",
"path": "/services/<pk>/add_follower"
},
{
"name": "Service add visit",
"code": "service-add-visit",
"path": "/services/<pk>/add_visit"
},
{
"name": "Service booking availability",
"code": "service-booking-availability",
"path": "/services/<pk>/booking_availability"
},
{
"name": "Service delete customer",
"code": "service-delete-customer",
"path": "/services/<pk>/customers/<customer_pk>/delete"
},
{
"name": "Service details",
"code": "service-detail",
"path": "/services/<pk>"
},
{
"name": "Service info",
"code": "services_info",
"path": "/services_info"
},
{
"name": "Service list",
"code": "service-list",
"path": "/services"
},
{
"name": "Service remove follower",
"code": "service-remove-follower",
"path": "/services/<pk>/remove_follower"
},
{
"name": "Service report",
"code": "service-report",
"path": "/services/<pk>/report"
},
{
"name": "Service reserve",
"code": "service-reserve",
"path": "/services/<pk>/reserve"
},
{
"name": "Service review service",
"code": "service-review-service",
"path": "/services/<pk>/review_service"
},
{
"name": "Services get",
"code": "get_services",
"path": "/get_services"
},
{
"name": "Service similars",
"code": "service-similars",
"path": "/services/<pk>/similars"
},
{
"name": "Service update customer",
"code": "service-udpate-customer",
"path": "/services/<pk>/customers/<customer_pk>/update"
},
{
"name": "Sevice retrieve customer",
"code": "service-retrieve-customer",
"path": "/services/<pk>/customers/<customer_pk>"
},
{
"name": "Shop check",
"code": "check_shop",
"path": "/check_shop"
},
{
"name": "Srvice list and create custom",
"code": "service-list-and-create-custom",
"path": "/services/<pk>/customers"
},
{
"name": "Subscription cancel",
"code": "cancel_subscription",
"path": "/subscriptions/<uuid:subscription_id>/cancel"
},
{
"name": "Subscription get active",
"code": "current_active_subscription",
"path": "/subscriptions/active"
},
{
"name": "Subscription update method",
"code": "update_payment_subscription",
"path": "/subscriptions/<uuid:subscription_id>/update-payme"
},
{
"name": "Subscription upgrade",
"code": "upgrade_subscription",
"path": "/subscriptions/upgrade"
},
{
"name": "Token details",
"code": "token-detail",
"path": "/token/<pk>"
},
{
"name": "Token list",
"code": "token-list",
"path": "/token"
},
{
"name": "Token refresh",
"code": "token_refresh",
"path": "/login/refresh"
},
{
"name": "Token submit token user",
"code": "token-submit-token-user",
"path": "/token/submit_token_user"
},
{
"name": "User change password",
"code": "user-change-password",
"path": "/users/change_password"
},
{
"name": "User code delete",
"code": "delete_user_code",
"path": "/delete_user_code"
},
{
"name": "User delete",
"code": "user-delete",
"path": "/users/delete"
},
{
"name": "User request pass reset",
"code": "user-request-password-reset",
"path": "/users/request_password_reset"
},
{
"name": "User search",
"code": "user-search",
"path": "/users/search"
},
{
"name": "User sign with social provider",
"code": "user-sign-with-social-provider",
"path": "/users/sign_with_social_provider"
},
{
"name": "Service create",
"code": "service-get-data-to-create",
"path": "/services/get_data_to_create"
},
{
"name": "Service update",
"code": "service-get-data-to-update",
"path": "/services/<pk>/get_data_to_update"
}
]
| Name | Code | Path |
|---|---|---|
| Account reset complete | password_reset_complete | /accounts/reset/done |
| Activate account | activate_account | /activate_account |
| Activate account code | activate_account_code | /reset_password_code |
| App version | get_version | /getVersion |
| Blog entry list | blogentry-list | /blog |
| Category list | category-list | /categories |
| Change language | change_languaje | /change_languaje |
| Chat | chat | /chat/str:pk |
| Chat create | create_chat | /chat/create |
| Chat delete | delete_chat | /chat/str:pk/delete |
| Chat details | chat_details | /chat/details/str:pk |
| Chat send message | send_message | /chat_messages/create |
| Chat Service owner | service_owner | /chat/serviceOwner |
| Chat unread messages | unread_messages | /chat/unreadMessages/str:pk |
| City get | city-getCity | /cities/getCity |
| City list | city-list | /cities |
| Country list | country-list | /countries |
| Get Data | get_data | /get_data |
| Invoice add item | add_item_invoice | /invoices/uuid:invoice_id/items |
| Invoice list or create | list_or_create_invoice | /invoices |
| Invoice pay | pay_invoice | /invoices/uuid:invoice_id/pay |
| Invoices Build reference | build_reference_invoice | /invoices/build-reference |
| Invoices retrieve or update | retrieve_or_update_invoice | /invoices/uuid:invoice_id |
| Invoices Update status | update_status_invoice | /invoices/uuid:invoice_id/status |
| Invoices View | view_invoice | /invoices/uuid:invoice_id/view |
| Invoice update or delete item | update_or_delete_item_invoice | /invoices/uuid:invoice_id/items/uuid:item_id |
| Live chat index | index | /livechat |
| Live chat room | room | /livechat/str:room_name |
| Login | user-login | /users/login |
| Logout | logout | /accounts/logout |
| Maintenance | maintenance | /maintenance |
| Message Received | message_received | /messageReceived |
| Municipality list | municipality-list | /municipalities |
| Password change | password_change | /accounts/password_change |
| Password change done | password_change_done | /accounts/password_change/done |
| Password reset | password_reset | /accounts/password_reset |
| Password reset confirm | password_reset_confirm | /accounts/reset// |
| Password reset done | password_reset_done | /accounts/password_reset/done |
| Payment complete | payment-complete | /payments/complete |
| Payment details | payment-detail | /payments/ |
| Payment list | payment-list | /payments |
| Payment method list | list_payment_method | /payment-methods |
| Payout account balance | get_account_balance_payout | /payouts/account/uuid:account_id/balance |
| Payout account enable | enable_account_payout | /payouts/account/uuid:account_id/enable |
| Payout account frequency | update_account_frequency_payou | /payouts/account/uuid:account_id/frequency |
| Payout Account get or create | retrieve_or_create_payout | /payouts/account |
| Payout create | create_payout | /payouts/uuid:account_id |
| Payout external accounts list | external_accounts_payout | /payouts/account/uuid:account_id/external-accoun |
| Payout frequency list | frequency_list_payout | /payouts/frequencies |
| Plan list | list_plan | /plans |
| Profile block user | block_user | /profile/block_user |
| Profile Booking Availability | profile-booking-availability | /profiles//booking_availability |
| Profile code friends | profile-code-friends | /profiles/code_friends |
| Profile Details | profile-detail | /profiles/ |
| Profile info | profile-profile-info | /profiles/profile_info |
| Profile list | profile-list | /profiles |
| Profile location | profile-location | /profiles/location |
| Profile notification delete | profile-delete | /profiles/notifications/delete |
| Profile notifications | profile-notifications | /profiles/notifications |
| Profile report | profile-report | /profiles//report |
| Profile reserves | profile-reserves | /profiles/reserves |
| Profile reserves submitted | profile-reserves-submitted | /profiles/reserves/submitted |
| Profile retrieve | retrieve_profile | /profile |
| Profile reviews | profile-reviews | /profiles/reviews |
| Profile seen | profile-seen | /profiles/notifications/seen |
| Pusher auth | pusher_auth | /pusher/auth |
| Report details list | reportdetail-list | /report_details |
| Resend code | resendCode | /resendCode |
| Resend code email | resendCode_Email | /resendCode_Email |
| Resend code email password | resendCode_Email_Password | /resendCode_Email_Password |
| Reserve accept | reserve-accept | /reserves//accept |
| Reserve cancel | reserve-cancel | /reserves//cancel |
| Reserve details | reserve-detail | /reserves/ |
| Reserve list | reserve-list | /reserves |
| Reset Password check token | check_reset_password_token | /check_reset_password_token/str:uidb64/<str:toke |
| Review answer | review-answer | /reviews//answer |
| Review destroy review | review-destroy-review | /reviews//delete |
| Review details | review-detail | /reviews/ |
| Review edit answer | review-edit-answer | /reviews/edit_answer |
| Review report | review-report | /reviews//report |
| Review update | review-updated-review | /reviews//update |
| Rsend code password | resendCode_Password | /resendCode_Password |
| Service add follower | service-add-follower | /services//add_follower |
| Service add visit | service-add-visit | /services//add_visit |
| Service booking availability | service-booking-availability | /services//booking_availability |
| Service delete customer | service-delete-customer | /services//customers/<customer_pk>/delete |
| Service details | service-detail | /services/ |
| Service info | services_info | /services_info |
| Service list | service-list | /services |
| Service remove follower | service-remove-follower | /services//remove_follower |
| Service report | service-report | /services//report |
| Service reserve | service-reserve | /services//reserve |
| Service review service | service-review-service | /services//review_service |
| Services get | get_services | /get_services |
| Service similars | service-similars | /services//similars |
| Service update customer | service-udpate-customer | /services//customers/<customer_pk>/update |
| Sevice retrieve customer | service-retrieve-customer | /services//customers/<customer_pk> |
| Shop check | check_shop | /check_shop |
| Srvice list and create custom | service-list-and-create-custom | /services//customers |
| Subscription cancel | cancel_subscription | /subscriptions/uuid:subscription_id/cancel |
| Subscription get active | current_active_subscription | /subscriptions/active |
| Subscription update method | update_payment_subscription | /subscriptions/uuid:subscription_id/update-payme |
| Subscription upgrade | upgrade_subscription | /subscriptions/upgrade |
| Token details | token-detail | /token/ |
| Token list | token-list | /token |
| Token refresh | token_refresh | /login/refresh |
| Token submit token user | token-submit-token-user | /token/submit_token_user |
| User change password | user-change-password | /users/change_password |
| User code delete | delete_user_code | /delete_user_code |
| User delete | user-delete | /users/delete |
| User request pass reset | user-request-password-reset | /users/request_password_reset |
| User search | user-search | /users/search |
| User sign with social provider | user-sign-with-social-provider | /users/sign_with_social_provider |
| Service create | service-get-data-to-create | /services/get_data_to_create |
| Service update | service-get-data-to-update | /services//get_data_to_update |

