curl --request PATCH \
--url https://api.goyappr.com/billing/details \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Ltd",
"address": {
"line1": "1 Example St",
"city": "Tel Aviv",
"postal_code": "6100000",
"country": "IL"
},
"tax_id": {
"type": "il_vat",
"value": "000012345"
}
}
'{
"name": "Acme Ltd",
"email": "billing@acme.example",
"address": {
"line1": "1 Example St",
"country": "IL",
"line2": "<string>",
"city": "Tel Aviv",
"state": "<string>",
"postal_code": "6100000"
},
"tax_id": {
"type": "il_vat",
"value": "000012345"
},
"language": "en"
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Update Billing Details
Change what invoices print. Send any of name, email, address, tax_id and
language; fields left out stay as they are. Required scope billing:manage.
null resets: name to the workspace name, email to the workspace owner’s email, and
removes the address or the tax ID. A workspace keeps one tax ID; sending a new one
replaces it, and a number that is not valid for its type is refused with
TAX_ID_INVALID and the old one stays.
A change applies to invoices issued after it. An invoice already issued is never
changed. Invoices are issued in English; language: he gives English invoices with
day-first dates. The answer is the same body GET /billing/details returns.
curl --request PATCH \
--url https://api.goyappr.com/billing/details \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Ltd",
"address": {
"line1": "1 Example St",
"city": "Tel Aviv",
"postal_code": "6100000",
"country": "IL"
},
"tax_id": {
"type": "il_vat",
"value": "000012345"
}
}
'{
"name": "Acme Ltd",
"email": "billing@acme.example",
"address": {
"line1": "1 Example St",
"country": "IL",
"line2": "<string>",
"city": "Tel Aviv",
"state": "<string>",
"postal_code": "6100000"
},
"tax_id": {
"type": "il_vat",
"value": "000012345"
},
"language": "en"
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}billing:manage.
A key without that scope is 403 INSUFFICIENT_SCOPE.
Send only what you are changing; a field you leave out stays as it is. The
response is the whole set, as GET /billing/details
returns it.
curl -X PATCH "https://api.goyappr.com/billing/details" \
-H "Authorization: Bearer $YAPPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Ltd",
"address": { "line1": "1 Example St", "city": "Tel Aviv", "postal_code": "6100000", "country": "IL" },
"tax_id": { "type": "il_vat", "value": "000012345" }
}'
{
"name": "Acme Ltd",
"email": "billing@acme.example",
"address": { "line1": "1 Example St", "line2": null, "city": "Tel Aviv", "state": null, "postal_code": "6100000", "country": "IL" },
"tax_id": { "type": "il_vat", "value": "000012345" },
"language": "en"
}
| Field | Send | null means |
|---|---|---|
name | 1 to 256 characters. | Use the workspace’s name. |
email | A full email address, up to 254 characters. | Use the workspace owner’s email. |
address | line1 and country (two letters, such as IL) are required; line2, city, state and postal_code are optional, up to 200 characters each. | Remove the address. |
tax_id | type and value (1 to 64 characters; spaces are removed). One tax ID per workspace: a new one replaces the old. | Remove the tax ID. |
language | en or he. | Not allowed. |
When it takes effect
The invoices issued after the change print the new details. An invoice that was already issued is never rewritten, so a correction shows from the next payment on. List the invoices themselves withGET /billing/invoices.
Invoices are issued in English whatever language says; he prints dates
day first.
Tax ID types
type | Country | Example |
|---|---|---|
il_vat | Israel — a VAT (עוסק מורשה) or company (ח.פ.) number | 000012345 |
eu_vat | European Union | DE123456789 |
gb_vat | United Kingdom | GB123456789 |
us_ein | United States | 12-3456789 |
ca_bn | Canada | 123456789 |
au_abn | Australia | 12345678912 |
ch_vat | Switzerland | CHE-123.456.789 MWST |
no_vat | Norway | 123456789MVA |
ae_trn | United Arab Emirates | 123456789012345 |
za_vat | South Africa | 4123456789 |
400 TAX_ID_INVALID,
and the tax ID you already had stays on.
Errors
| HTTP | code | When |
|---|---|---|
400 | BILLING_DETAILS_EMPTY | The body names none of name, email, address, tax_id or language. |
400 | BILLING_DETAILS_UNKNOWN_FIELD | The body has a field that is not a billing detail. Nothing was changed. |
400 | BILLING_NAME_INVALID | name is empty or longer than 256 characters. |
400 | BILLING_EMAIL_INVALID | email is not a full email address. |
400 | BILLING_ADDRESS_INVALID | address has no line1, or no two-letter country. |
400 | TAX_ID_TYPE_UNSUPPORTED | tax_id.type is not one of the types above. |
400 | TAX_ID_INVALID | tax_id.value is not a valid number of its type. |
400 | BILLING_LANGUAGE_INVALID | language is not en or he. |
403 | INSUFFICIENT_SCOPE | The key does not hold billing:manage. |
502 | BILLING_UNAVAILABLE | The details could not be saved right now. Some details may have been saved; read GET /billing/details and try again. |
Authorizations
Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).
Body
Response
The billing details, as saved