Comment on page
Create an avalara account
How to create an avalara account via API
To create a new avalara account, send a
POST
request to the /api/avalara_accounts
endpoint, passing the resource arguments in the request body.POST https://yourdomain.commercelayer.io/api/avalara_accounts
Body Parameter | Type | Required |
---|---|---|
type | string | Required |
attributes.name | string | Required |
attributes.reference | string | Optional |
attributes.reference_origin | string | Optional |
attributes.metadata | object | Optional |
attributes.username | string | Required |
attributes.password | string | Required |
attributes.company_code | string | Required |
attributes.commit_invoice | string | Optional |
attributes.ddp | string | Optional |
relationships.tax_categories | array | Optional |
Request
Response
The following request creates a new avalara account:
curl -g -X POST \
'https://yourdomain.commercelayer.io/api/avalara_accounts' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "avalara_accounts",
"attributes": {
"name": "Personal tax calculator",
"username": "[email protected]",
"password": "secret",
"company_code": "MYCOMPANY"
}
}
}'
On success, the API responds with a
201 Created
status code, returning the created resource object:{
"data": {
"id": "xYZkjABcde",
"type": "avalara_accounts",
"links": {
"self": "https://yourdomain.commercelayer.io/api/avalara_accounts/xYZkjABcde"
},
"attributes": {
"name": "Personal tax calculator",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
},
"username": "[email protected]",
"company_code": "MYCOMPANY",
"commit_invoice": "true",
"ddp": "true"
},
"relationships": {
"markets": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/avalara_accounts/xYZkjABcde/relationships/markets",
"related": "https://yourdomain.commercelayer.io/api/avalara_accounts/xYZkjABcde/markets"
}
},
"attachments": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/avalara_accounts/xYZkjABcde/relationships/attachments",
"related": "https://yourdomain.commercelayer.io/api/avalara_accounts/xYZkjABcde/attachments"
}
},
"versions": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/avalara_accounts/xYZkjABcde/relationships/versions",
"related": "https://yourdomain.commercelayer.io/api/avalara_accounts/xYZkjABcde/versions"
}
},
"tax_categories": {
"links": {
"self": "https://yourdomain.commercelayer.io/api/avalara_accounts/xYZkjABcde/relationships/tax_categories",
"related": "https://yourdomain.commercelayer.io/api/avalara_accounts/xYZkjABcde/tax_categories"
}
}
},
"meta": {
"mode": "test"
}
}
}
Last modified 3mo ago