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.
Request
POST https://yourdomain.commercelayer.io/api/avalara_accounts
Arguments
Body Parameter | Type | Required |
---|
| | |
| | |
| | |
attributes.reference_origin | | |
| | |
| | |
| | |
| | |
attributes.commit_invoice | | |
| | |
relationships.tax_categories | | |
Example
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": "user@mydomain.com",
"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": "user@mydomain.com",
"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 updated