NAV
Curl

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
}
AttributeTypeDescription
iduuidUnique identifier for the plan.
namestring(30)Name of the plan.
pricebigintThe amount a user should pay to subscribe to this plan.
currencystringCurrency in which user will pay in this plan. Maximum length is 3.
intervalstringOne of: month, year.
interval_countintIndicates the counter for inteval.
activeboolIndicates whether the plan is active or not.
is_recommendedboolIndicate if the plan is recommended. Only one plan can be recommended.
weightintThe order of priority of the plan. Indicates if one plan is superior to another.
trial_period_daysintIf the plan includes trial days, expresses the number in days.
is_defaultboolWhether 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

CodeMessage
internal_errorOpps something went wrong.

Payment methods

Payment method object

{
  "id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
  "name": "Stripe",
  "payout_enable": true,
  "is_default": true
}
AttributeTypeDescription
iduuidUnique identifier for the payment method.
typestringOne of: stripe.
payout_enabledbooleanIndicates whether the payout is enabled.
is_defaultbooleanIndicates 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

CodeMessage
internal_errorOpps 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
	}
  }
}
AttributeTypeDescription
iduuidUnique identifier for the subscription.
start_atbigintExpresses in timestamp the day of the subscription. Should be in UNIX timestamp format.
end_atbigintExpresses in timestamp the day when the subscription should end and need to be renewed or cancelled. Should be in UNIX timestamp format.
canceled_atbigintIndicates when the client canceled the subscription. Note that client cancel today but subscriptions will end at the end of period.
statusstringStatus of the subscription. One of: trailing, active, canceled, unpaid, canceled_due_update.
next_planarrayIf present, indicate the details about the next plan that will start after current one expires.
method_detailsarrayContains the details about the default payment method of the subscription. This method will be used in the next invoice.
planPlanDetails about the plan related to the subscription.
last_paymentPaymentDetails 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

Subscription object

Response errors

CodeMessage
internal_errorOpps 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

FieldTypeRequiredDescription
plan_iduuidyesThe plan to which the customer wants to upgrade.
success_urlurlyesThe url where the customer should be redirected after success process.
cancel_urlurlyesThe url where the customer should be redirected after failed process.
payment_method_iduuidnoThe payment method the customer prefer to use. No applicable now due only one PM.

Response success

CodeFieldAlwaysDescription
428redirect_urlnoOnly 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.
200codenoOne 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 CodeCodeMessage
400missing_paramIf some required param is not present in the request.
400unrecognized_parameterUnrecognized param is present in the request.
400invalid_paramSome param did not pass the validation due wrong value.
400multi_rowUser have more than one active subscription.
400already_have_resourceUser already have the desired plan.
404not_foundNo plan was found with the id under plan_id param.
404not_foundIf present payment_method_id and is not found.
404not_foundUser does not have any active subscription.
412configuration_neededThe product price for the subscription in the remote payment method was not configured yet.
500internal_errorOpps something went wrong.
503service_unavailableConnection 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

CodeFieldAlwaysDescription
204empty responseYesAlways empty response.

Response errors

Http CodeCodeMessage
404not_foundNo subscription id not found.
400forbidden_resourceSent subscription id does not belong to the logged user.
400status_value_deniedThe subscription to cancel is not in status trailing or active.
400non_processableThe subscription id on the remote server was not on DB.
503service_unavailableConnection with external service (Paypal, Stripe, etc) failed. Operation can not continue.
500internal_errorOpps 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

FieldTypeRequiredDescription
success_urlurlyesThe url where the customer should be redirected after success process.
cancel_urlurlyesThe url where the customer should be redirected after failed process.
payment_method_iduuidnoThe payment method the customer prefer to use. No applicable now due only one PM.

Response success

CodeFieldAlwaysDescription
428redirect_urlyesAlways present.

Response errors

Http CodeCodeMessage
400missing_paramIf some required param is not present in the request.
400unrecognized_parameterUnrecognized param is present in the request.
400invalid_paramSome param did not pass the validation due wrong value.
404not_foundNo subscription id not found.
400forbidden_resourceSent subscription id does not belong to the logged user.
400non_processableThe subscription id on the remote server was not on DB.
503service_unavailableConnection with external service (Paypal, Stripe, etc) failed. Operation can not continue.
500internal_errorOpps 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": {}
  }
}
AttributeTypeDescription
iduuidUnique identifier for the invoice.
referencestring(50)Reference number for the current invoice.
amountbigintThe amount auto calculated by server with the sum of all items.
currencystringCurrency in format ISO3.
statusstringOne of: draft, ready,paid,canceled.
created_atbigintDate of invoice creation.
updated_atbigintDate of updating invoice.
itemsArray<InvoiceItem>List of items of current invoice.
customerCustomerThe customer to whom the invoice was generated.
serviceServiceList 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

FieldTypeRequiredDescription
service_idstringnoThe service_id by which to apply the filter.
limitintyesHow many rows will be included in the response in case that exists such limit.
next_pagestringnoThe ID for the next page. First request do not require this params, but it will be necessary for the next requests.
statusstringnoEntity status in case filter by status is needed.
order_bystringnoThis property should be valid on Entity model. If order_by is not present, created_at DESC will be used.

Response success

CodeFieldTypeAlways
200next_pageuuidyes
200dataArray<Invoice>yes

Response errors

Http CodeCodeMessage
404not_foundNo 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.
500internal_errorOpps 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

FieldTypeRequiredDescription
service_idstringyesThe service for which the invoice will be created.
service_customer_iduuidyesThe client of the service to whom the invoice will be generated.
referencestringyesUnique identifier for the invoice. Uniqueness is per service, not per customer service.
currencystringnoCurrency in format ISO3.

Response success

CodeFieldAlwaysDescription
201InvoiceyesNote that not all objects related are present in response object.

Response errors

Http CodeCodeMessage
404not_foundIf some required param was not found on DB Or it does not belong to logged user.
409row_existsIf reference already exists in one Invoice for the same service_id.
500internal_errorOpps 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

CodeFieldAlwaysDescription
200InvoiceyesNote that not all objects related are present in response object.

Response errors

Http CodeCodeMessage
404not_foundIf the invoice was not found or it does not belong to logged user.
500internal_errorOpps 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

FieldTypeRequiredDescription
service_customer_iduuidnoThe client of the service to whom the invoice will be generated.
referencestringnoUnique identifier for the invoice. Uniqueness is per service, not per customer service.
currencystringnoCurrency in format ISO3.

Response success

CodeFieldAlwaysDescription
204empty responseYesAlways empty response.

Response errors

Http CodeCodeMessage
400status_value_deniedIf invoice status is different to DRAFT.
404not_foundIf some of sent param was not found on DB or it does not belong to logged user.
409row_existsIf reference was sent and already exists in one Invoice for the same service_id.
500internal_errorOpps something went wrong.

Update status

Update status of the invoices. Below you can find the statuses flow:

From StatusAllowed status
draftready, canceled
readydraft, canceled
canceledno allowed any status
paidno 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

FieldTypeRequiredDescription
statusstringyesThe new status for the invoice. One of: **draft,ready, canceled **

Response success

CodeFieldAlwaysDescription
204empty responseYesAlways empty response.

Response errors

Http CodeCodeMessage
400status_value_deniedIf sent status can not be take place. Example sending PAID status.
400non_processableIf sent status was READY but invoice has not items.
404not_foundIf invoice was not found on DB or it does not belong to logged user.
500internal_errorOpps 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:

-> If previous invoices for that service already exist in the DB, then:

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

FieldTypeRequiredDescription
service_idstringyesThe service_id by which to generate a invoice and generate the reference.

Response success

CodeFieldAlways
200referenceyes

Response errors

Http CodeCodeMessage
404not_foundNo 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.
500internal_errorOpps 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

CodeFieldAlwaysDescription
200InvoiceyesNote that not all objects related are present in response object.

Response errors

Http CodeCodeMessage
404not_foundIf the invoice was not found or it does not belong to logged user.
500internal_errorOpps 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

FieldTypeRequiredDescription
success_urlurlyesThe url where the customer should be redirected after success process.
cancel_urlurlyesThe url where the customer should be redirected after failed process.
payment_method_iduuidnoThe payment method the customer prefer to use. No applicable now due only one PM.

Response success

CodeFieldAlwaysDescription
428redirect_urlyesThe url where the user will be redirected for the payment.

Response errors

Http CodeCodeMessage
400status_value_deniedIf invoice status is different to READY.
404not_foundIf payment_method_id was sent and it was not found on DB.
412configuration_neededIn case that payment_id was not sent, the server could not find any Payment Method with default =True.
503service_unavailableThe communication with external service of payment method failed.
500internal_errorOpps 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

FieldTypeRequiredDescription
namestringyesName for the item.
priceintyesThe price for current item. The operation price*quantity will be reflected in invoice amount.
quantityintyesHow many of this item are in the invoice. The operation price*quantity will be reflected in invoice amount.
descriptionstringnoText describing the item.
taxdecimalnoIndicates the tax value in case that apply to this item. Also affect the invoice amount.

Response success

CodeFieldAlways
201InvoiceItemyes

Response errors

Http CodeCodeMessage
400status_value_deniedIf invoice status is different to DRAFT.
404not_foundInvoice was not found on DB or it does not belong to the logged-in user.
500internal_errorOpps 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

FieldTypeRequiredDescription
namestringnoName for the item.
priceintnoThe price for current item. The operation price*quantity will be reflected in invoice amount.
quantityintnoHow many of this item are in the invoice. The operation price*quantity will be reflected in invoice amount.
descriptionstringnoText describing the item.
taxdecimalnoIndicates the tax value in case that apply to this item. Also affect the invoice amount.

Response success

CodeFieldAlwaysDescription
204empty responseYesAlways empty response.

Response errors

Http CodeCodeMessage
400status_value_deniedIf invoice status is different to DRAFT.
404not_foundInvoice was not found on DB or it does not belong to the logged-in user.
500internal_errorOpps 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

CodeFieldAlwaysDescription
204empty responseYesAlways empty response.

Response errors

Http CodeCodeMessage
400status_value_deniedIf invoice status is different to DRAFT.
404not_foundInvoice was not found on DB or it does not belong to the logged-in user.
500internal_errorOpps 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

CodeFieldAlways
200[Profile]yes

Response errors

Http CodeCodeMessage
500internal_errorOpps 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
}
AttributeTypeDescription
iduuidUnique identifier for the entity.
frequencystringOne of: auto_daily, auto_3_days, auto_7_days, on_demand.
currencystringCurrency in format ISO3. The currency here reflect the default currency into the externals accounts.
payment_method_typestringPayment method to which belong this account.
statusstringOne of: pending, completed, suspended, deleted.
countrystringCountry of the account.
external_accountsarrayContains 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_atbigintCreation date.
updated_atbigintLast 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

CodeFieldAlways
200Arrayyes

Response errors

Http CodeCodeMessage
500internal_errorOpps 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

CodeFieldAlwaysDescription
204empty responseyesNo data in response.

Response errors

Http CodeCodeMessage
404not_foundIf sent payment_method_id was not found on DB Or it does not belong to logged user.
409row_existsIf user already have and COMPLETED account in the sent payment_method_id.
500internal_errorOpps something went wrong.
503service_unavailableConnection 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

FieldTypeRequiredDescription
refresh_urlstringyesThis is actually the same url that you are making the request.
return_urlstringyesThe url were to redirect in case of success.

Response success

CodeFieldAlwaysDescription
428redirect_urlyesThe url where to redirect the user to perform the payout account process in external system.

Response errors

Http CodeCodeMessage
404not_foundIf the account id sent was not found on DB Or it does not belong to logged user.
500internal_errorOpps something went wrong.
503service_unavailableConnection 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

CodeFieldAlways
200Payout User Accountyes

Response errors

Http CodeCodeMessage
404not_foundUser dont have any pending or active account.
500internal_errorOpps 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

FieldTypeRequiredDescription
frequencystringyesOne 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

CodeFieldAlways
204empty responseyes

Response errors

Http CodeCodeMessage
400status_value_deniedIn case that the frequency sent can not be performed according with the user plan.
404not_foundIf sent account_id sent was not found on DB Or it does not belong to logged user.
500internal_errorOpps something went wrong.
503service_unavailableConnection 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

CodeFieldAlways
200Objectyes

Response errors

Http CodeCodeMessage
400status_value_deniedIf the account has not status COMPLETED.
404not_foundIf the account id sent was not found on DB Or it does not belong to logged user.
500internal_errorOpps something went wrong.
503service_unavailableConnection 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

CodeFieldAlways
200Objectyes

Response errors

Http CodeCodeMessage
400status_value_deniedIf the account has not status COMPLETED.
404not_foundIf the account id sent was not found on DB Or it does not belong to logged user.
500internal_errorOpps something went wrong.
503service_unavailableConnection 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

FieldTypeRequiredDescription
currencystringyesThe payout currency.
amountbigintyesThe payout amount.
instantboolyesSpecify 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

CodeFieldAlways
204empty responseyes

Response errors

Http CodeCodeMessage
400status_value_deniedIf the frequency of the sent account is not on_demand.
400balance_insufficientIf the user account has not enough funds for the desired amount.
404not_foundIf sent payment_method_id was not found on DB Or it does not belong to logged user.
500internal_errorOpps something went wrong.
503service_unavailableConnection 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

FieldTypeRequiredDescription
limitintyesHow many rows will be included in the response in case that exists such limit.
next_pagestringnoThe ID for the next page. First request do not require this params, but it will be necessary for the next requests.
statusstringnoEntity status in case filter by status is needed.
order_bystringnoThis property should be valid on Entity model. If order_by is not present, created_at DESC will be used.

Response success

CodeFieldTypeAlways
200next_pageuuidyes
200dataArray<Payout>yes

Response errors

Http CodeCodeMessage
500internal_errorOpps 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

FieldTypeRequiredDescription
channelstringyesThe channel that will be used for sending the notification. One of: email_notification,sms_notification.
scopestring<Scope>yesSpecify the scope or the action that should be notified. Scope list change according to the channel.
target_idstringyesThe 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

CodeFieldAlwaysDescription
204empty responseYesAlways empty response.

Response errors

Http CodeCodeMessage
400status_value_deniedOnly invoices with status READY can be share with the customer.
404not_foundThere is not handler for requested scope.
412status_value_deniedUser has not activation code generated.
500internal_errorOpps something went wrong.
501not_implementedThis functionality is not yet implemented.

Notification channels

Email notification scopes

List of all possible scopes that can be sent with the channel email_notification

KeyDescription
welcomeSend welcome email and include the initial email verification.
email_verificationSend email verification code in case that welcome email did not arrived.
request_password_codeSend verification code for reset password request.
password_updatedInform to user that password was updated.
invoice_createdNotify to customer that service provider issue an invoice.
invoice_paidSend email to invoice payer for confirming invoice paid.
booking_createdNotify to Service owner that new booking was requested and is waiting for confirmation.
booking_owner_canceledNotify to user that service owner has canceled the booking.
booking_user_canceledNotify to owner that user has canceled the booking.
booking_approvedNotify to user that service owner has approved the booking.
subscription_updatedNotify to user that subscription was updated.
subscription_canceledNotify to user that subscription was canceled.
payout_updatedNotify to user that requested payout was updated.

Sms notification scopes

List of all possible scopes that can be sent with the channel sms_notification

KeyDescription
NO IMPLEMENTED YETNO IMPLEMENTED YET

Data Transfer Objects

PaymentMethod

{
  "id": "9742d55e-4a76-4b4e-9a36-0e5162579e51",
  "name": "Stripe",
  "payout_enable": true,
  "is_default": true
}
AttributeTypeDescription
iduuidUnique identifier for the payment method.
typestringOne of: stripe.
payout_enabledbooleanIndicates whether the payout is enabled.
is_defaultbooleanIndicates 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
}
AttributeTypeDescription
namestringName of the permission.
codestringA unique code for the action involved.
max_allowed_valueintegerFor actions handling numeric items, this expresses the max allowed value.
metadatastringExtra 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
}
AttributeTypeDescription
iduuidUnique identifier for the plan.
namestring(30)Name of the plan.
pricebigintThe amount a user should pay to subscribe to this plan.
currencystringCurrency in which user will pay in this plan. Maximum length is 3.
intervalstringOne of: month, year.
interval_countintIndicates the counter for inteval.
activeboolIndicates whether the plan is active or not.
is_recommendedboolIndicate if the plan is recommended. Only one plan can be recommended.
weightintThe order of priority of the plan. Indicates if one plan is superior to another.
trial_period_daysintIf the plan includes trial days, expresses the number in days.
is_defaultboolWhether 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
	}
  }
}
AttributeTypeDescription
iduuidUnique identifier for the subscription.
start_atbigintExpresses in timestamp the day of the subscription. Should be in UNIX timestamp format.
end_atbigintExpresses in timestamp the day when the subscription should end and need to be renewed or cancelled. Should be in UNIX timestamp format.
canceled_atbigintIndicates when the client canceled the subscription. Note that client cancel today but subscriptions will end at the end of period.
statusstringStatus of the subscription. One of: trailing, active, canceled, unpaid, canceled_due_update.
next_planarrayIf present, indicate the details about the next plan that will start after current one expires.
method_detailsarrayContains the details about the default payment method of the subscription. This method will be used in the next invoice.
planPlanDetails about the plan related to the subscription.
last_paymentPaymentDetails 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": {}
  }
}
AttributeTypeDescription
iduuidUnique identifier for the invoice.
referencestring(50)Reference number for the current invoice.
amountbigintThe amount auto calculated by server with the sum of all items.
currencystringCurrency in format ISO3.
statusstringOne of: draft, ready,paid,canceled.
created_atbigintDate of invoice creation.
updated_atbigintDate of updating invoice.
itemsArray<InvoiceItem>List of items of current invoice.
customerCustomerThe customer to whom the invoice was generated.
serviceServiceList 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
}
AttributeTypeDescription
iduuidUnique identifier for the item.
namestring(30)Name of the item.
pricebigintThe price for current item.
quantityintHow many of this item are in the invoice.
descriptionstringText describing the item.
taxdoubleIndicates 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": []
}
AttributeTypeDescription
iduuidUnique identifier for the invoice.
first_namestringFirst name for user.
last_namestringLast name for user.
selected_languagestringCurrent language of user.
addressstringAddress of user.
citystringCity of user.
countrystringCountry of user.
statestringState of user.
zip_codestringZip code of user.
number_friendsintNumber of friends.
profitdecimalThe money accumulated.
refer_codestringThe invite code of the user.
nitstringNit of the user.
emailstringEmail of the user.
phonestringPhone of the user.
activeboolIndicate if user is active or not.
created_atbigintDate of user creation.
updated_atbigintDate of updating user.
rolesArray<String>The list contains not the role object but the code of the role.
permissionsArray<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": {}
}
AttributeTypeDescription
iduuidUnique identifier for the invoice.
slug_idstringService slug. @deprecated in favor of slug
slugstringService slug.
statusstringOne of: created, published, unpublished, suspended
namestringName of the service.
category_idstringThe id of category.
coverstringCover img url.
logostringLogo img url.
average_ratingstringAverage rating.
number_of_reviewsstringNumber of review of service.
expiration_datestringThe expiration date. @deprecated in favor of expires_at
expires_atstringThe expiration date.
visitsarrayList of visit objets.
descriptionstringDescription of the service.
telephonestringPhone of the service.
cellphonestringMobile number of the service.
websitestringWebsite url of the service.
expiration_date(@deprecated)datetimeDatetime with the expiration date.
expires_atbigintBigint with the expiration date.
ownerUserThe 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
	  }
	]
  }
}
AttributeTypeDescription
referenceuuidUnique identifier for the payment.
gross_amountbigintThe amount before fees.
net_amountbigintAmount after fees.
fee_amountbigintFee amount applied.
fee_percentdecimalFee percent applied.
currencystringCurrency in format ISO3.
detailsjsonDetails about the method used for the payment.
created_atbigintDate of payment creation.
statusstringOne of: pending, completed, refunded,failed.
targetstringOne of: subscription, invoice.
methodstringPayment method used for the payment. Note this is not about card, this is more about Stripe, Paypal, etc.
invoiceInvoiceIf payment was for target invoice: the involed paid.
planPlanIf 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
}
AttributeTypeDescription
iduuidUnique identifier for the entity.
frequencystringOne of: auto_daily, auto_3_days, auto_7_days, on_demand.
currencystringCurrency in format ISO3. The currency here reflect the default currency into the externals accounts.
payment_method_typestringPayment method to which belong this account.
statusstringOne of: pending, completed, suspended, deleted.
countrystringCountry of the account.
external_accountsarrayContains 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_atbigintCreation date.
updated_atbigintLast 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": []
  }
}
AttributeTypeDescription
iduuidUnique identifier for the invoice.
statusstringOne of: pending, in_transit, paid, canceled, failed, requested.
amountbigintPayout amount.
currencystringCurrency in format ISO3.
arrival_datebigintArrival data of payout.
automaticboolIf payout was automatic or not.
sent_methodstringThe method used for sending the payout. One of: standard, instant
typestringThe type of destination customer used for the payout. One of: bank_account, card.
descriptionstringDescription about the payout.
created_atbigintDate of user creation.
updated_atbigintDate of updating user.
destination_accountPayout User AccountDestination account where the funds were sent.
userUserOur 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
  }
}
AttributeTypeDescription
iduuidUnique identifier for the customer.
first_namestringFirst name of the customer.
last_namestringLast name for customer.
business_namestringBusiness name for customer.
emailstringEmail of the customer.
phonestringPhone of the customer.
created_atbigintDate of customer creation.
updated_atbigintDate of updating customer.
serviceServiceService where the customer belong to.

Errors list

Describe all possibles api internal errors.

KeyDescription
invalid_tokenThe token is invalid.
require_activationThe activation of the resource is mandatory.
bad_credentialsInvalid credentials.
not_foundResource not found.
already_have_resourceThe target entity already has the resource.
multi_rowThe target entity has more than one object.
configuration_neededConfiguration is needed on server side that denied the request.
missing_paramRequired param was not present in the request.
forbidden_empty_requestNo params was sent to endpoint that requires at least one parameter.
unrecognized_parameterRequest contains a parameter that is not in the list of expected ones.
invalid_paramParams is expected by request, but the value is not valid.
status_value_deniedThe resource has wrong status for the operation. Eg, cancel subscription no active.
service_unavailableThe endpoint depends of external services who failed.
forbidden_resourceRequest denied due lack of permission. Eg, cancel a subscription that does not belong to the logged user.
non_upgradableResource can not be change from one status to another due limitations. Eg, upgrade to Basic subscription.
non_processableResource can not be process due mandatory params is not presend on DB row.
row_existsAlready exits a row with tha value. Normally reflect a conflict.
internal_errorUnexpected 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
  }
AttributeDescription
dataCan be array or object.

Error response

{
  "internal_code": "not_found",
  "message": "Resource not found.",
  "field": "subscription_id"
}
NameValueDescription
codestringInternal API code response.
messagestringDescription for the internal internal_code code response.
fieldarraySpecify 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"
  }
]
NameCodePath
Account reset completepassword_reset_complete/accounts/reset/done
Activate accountactivate_account/activate_account
Activate account codeactivate_account_code/reset_password_code
App versionget_version/getVersion
Blog entry listblogentry-list/blog
Category listcategory-list/categories
Change languagechange_languaje/change_languaje
Chatchat/chat/str:pk
Chat createcreate_chat/chat/create
Chat deletedelete_chat/chat/str:pk/delete
Chat detailschat_details/chat/details/str:pk
Chat send messagesend_message/chat_messages/create
Chat Service ownerservice_owner/chat/serviceOwner
Chat unread messagesunread_messages/chat/unreadMessages/str:pk
City getcity-getCity/cities/getCity
City listcity-list/cities
Country listcountry-list/countries
Get Dataget_data/get_data
Invoice add itemadd_item_invoice/invoices/uuid:invoice_id/items
Invoice list or createlist_or_create_invoice/invoices
Invoice paypay_invoice/invoices/uuid:invoice_id/pay
Invoices Build referencebuild_reference_invoice/invoices/build-reference
Invoices retrieve or updateretrieve_or_update_invoice/invoices/uuid:invoice_id
Invoices Update statusupdate_status_invoice/invoices/uuid:invoice_id/status
Invoices Viewview_invoice/invoices/uuid:invoice_id/view
Invoice update or delete itemupdate_or_delete_item_invoice/invoices/uuid:invoice_id/items/uuid:item_id
Live chat indexindex/livechat
Live chat roomroom/livechat/str:room_name
Loginuser-login/users/login
Logoutlogout/accounts/logout
Maintenancemaintenance/maintenance
Message Receivedmessage_received/messageReceived
Municipality listmunicipality-list/municipalities
Password changepassword_change/accounts/password_change
Password change donepassword_change_done/accounts/password_change/done
Password resetpassword_reset/accounts/password_reset
Password reset confirmpassword_reset_confirm/accounts/reset//
Password reset donepassword_reset_done/accounts/password_reset/done
Payment completepayment-complete/payments/complete
Payment detailspayment-detail/payments/
Payment listpayment-list/payments
Payment method listlist_payment_method/payment-methods
Payout account balanceget_account_balance_payout/payouts/account/uuid:account_id/balance
Payout account enableenable_account_payout/payouts/account/uuid:account_id/enable
Payout account frequencyupdate_account_frequency_payou/payouts/account/uuid:account_id/frequency
Payout Account get or createretrieve_or_create_payout/payouts/account
Payout createcreate_payout/payouts/uuid:account_id
Payout external accounts listexternal_accounts_payout/payouts/account/uuid:account_id/external-accoun
Payout frequency listfrequency_list_payout/payouts/frequencies
Plan listlist_plan/plans
Profile block userblock_user/profile/block_user
Profile Booking Availabilityprofile-booking-availability/profiles//booking_availability
Profile code friendsprofile-code-friends/profiles/code_friends
Profile Detailsprofile-detail/profiles/
Profile infoprofile-profile-info/profiles/profile_info
Profile listprofile-list/profiles
Profile locationprofile-location/profiles/location
Profile notification deleteprofile-delete/profiles/notifications/delete
Profile notificationsprofile-notifications/profiles/notifications
Profile reportprofile-report/profiles//report
Profile reservesprofile-reserves/profiles/reserves
Profile reserves submittedprofile-reserves-submitted/profiles/reserves/submitted
Profile retrieveretrieve_profile/profile
Profile reviewsprofile-reviews/profiles/reviews
Profile seenprofile-seen/profiles/notifications/seen
Pusher authpusher_auth/pusher/auth
Report details listreportdetail-list/report_details
Resend coderesendCode/resendCode
Resend code emailresendCode_Email/resendCode_Email
Resend code email passwordresendCode_Email_Password/resendCode_Email_Password
Reserve acceptreserve-accept/reserves//accept
Reserve cancelreserve-cancel/reserves//cancel
Reserve detailsreserve-detail/reserves/
Reserve listreserve-list/reserves
Reset Password check tokencheck_reset_password_token/check_reset_password_token/str:uidb64/<str:toke
Review answerreview-answer/reviews//answer
Review destroy reviewreview-destroy-review/reviews//delete
Review detailsreview-detail/reviews/
Review edit answerreview-edit-answer/reviews/edit_answer
Review reportreview-report/reviews//report
Review updatereview-updated-review/reviews//update
Rsend code passwordresendCode_Password/resendCode_Password
Service add followerservice-add-follower/services//add_follower
Service add visitservice-add-visit/services//add_visit
Service booking availabilityservice-booking-availability/services//booking_availability
Service delete customerservice-delete-customer/services//customers/<customer_pk>/delete
Service detailsservice-detail/services/
Service infoservices_info/services_info
Service listservice-list/services
Service remove followerservice-remove-follower/services//remove_follower
Service reportservice-report/services//report
Service reserveservice-reserve/services//reserve
Service review serviceservice-review-service/services//review_service
Services getget_services/get_services
Service similarsservice-similars/services//similars
Service update customerservice-udpate-customer/services//customers/<customer_pk>/update
Sevice retrieve customerservice-retrieve-customer/services//customers/<customer_pk>
Shop checkcheck_shop/check_shop
Srvice list and create customservice-list-and-create-custom/services//customers
Subscription cancelcancel_subscription/subscriptions/uuid:subscription_id/cancel
Subscription get activecurrent_active_subscription/subscriptions/active
Subscription update methodupdate_payment_subscription/subscriptions/uuid:subscription_id/update-payme
Subscription upgradeupgrade_subscription/subscriptions/upgrade
Token detailstoken-detail/token/
Token listtoken-list/token
Token refreshtoken_refresh/login/refresh
Token submit token usertoken-submit-token-user/token/submit_token_user
User change passworduser-change-password/users/change_password
User code deletedelete_user_code/delete_user_code
User deleteuser-delete/users/delete
User request pass resetuser-request-password-reset/users/request_password_reset
User searchuser-search/users/search
User sign with social provideruser-sign-with-social-provider/users/sign_with_social_provider
Service createservice-get-data-to-create/services/get_data_to_create
Service updateservice-get-data-to-update/services//get_data_to_update