Skip to main content

Create / Update a provider account

This API lets you create or update an e-invoice provider account. If you pass id, the existing account is updated; otherwise a new one is created (duplicates are checked by merchantId + provider + taxCode).

POST
URLhttps://open-api.tingee.vn/v1/e-invoice/create-or-update-account

Create or update an e-invoice provider account.

Header Request​

HeaderRequiredDescription
Content-Type✓application/json
x-client-id✓Partner identifier issued by TINGEE.
x-signature✓HMAC SHA512 authentication signature. See How to generate the signature.
x-request-timestamp✓Time the request is sent (format: yyyyMMddHHmmssSSS, UTC+7)

Body Parameter​

FieldTypeRequiredDescription
idnumber✕Account ID (pass it to update, leave it empty to create).
merchantIdnumber✕Merchant ID.
(Required if you connect with a Master Merchant account).
providerstring✓Provider: x-cyber, hilo, s-invoice, misa, bkav.
taxCodestring✓Business tax code.
usernamestring✓Username of the provider account.
passwordstring✓Account password (stored encrypted).
isDefaultboolean✕Set as the default account (Default: false).
The Merchant's first account is always set as the default; when set to true, the other accounts are no longer the default.
isActiveboolean✕Activate the account (Default: true).
servicesarray✕Services used with the account: output-invoice (sales invoices), input-invoice (purchase invoices). Default ["output-invoice"].
On update, the services you pass are added to the existing list.
The input-invoice service currently only supports the x-cyber provider.

Code samples​

curl --location --request POST 'https://open-api.tingee.vn/v1/e-invoice/create-or-update-account' \
--header 'accept: application/json' \
--header 'x-client-id: YOUR_CLIENT_ID' \
--header 'x-request-timestamp: 20240509154004003' \
--header 'x-signature: YOUR_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"provider": "x-cyber",
"taxCode": "0101234567",
"username": "admin@company.vn",
"password": "your_password",
"isDefault": true,
"isActive": true
}'

Sample Response​

{
"code": "00",
"message": "Success",
"data": 1
}
FieldTypeDescription
codestringResult code (00 = Success).
messagestringResponse message.
datanumberID of the provider account that was just created or updated.

Common error codes​

CodeDescriptionHow to handle
2037The provider account could not be authenticated or is not registered for sales invoicesCheck provider, taxCode, username, password and make sure you have registered for the service with the provider.
2036The account is not registered for the provider's purchase invoice serviceRegister for the purchase invoice service with the provider, or remove input-invoice from services.
2007The provider does not support the purchase invoice service yetOnly x-cyber supports input-invoice.
1057The account to update was not foundCheck id; omit id if you want to create a new account.
90, 91, 92, 97Request authentication error (timestamp, client-id, signature)See System error codes.
OthersOther errorsSee Error codes.