Skip to content

Commit b53f3ad

Browse files
authored
Merge pull request #649 from recurly/v3-v2021-02-25-5146870733
Generated Latest Changes for v2021-02-25 (Multiple Business Entities)
2 parents 58e3a35 + 12b0f93 commit b53f3ad

File tree

3 files changed

+350
-0
lines changed

3 files changed

+350
-0
lines changed

openapi/api.yaml

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ x-tagGroups:
228228
- custom_field_definition
229229
- shipping_method
230230
- dunning_campaigns
231+
- business_entities
231232
tags:
232233
- name: site
233234
x-displayName: Site
@@ -374,6 +375,10 @@ tags:
374375
description: An account from an external resource that is not managed by the Recurly
375376
platform and instead is managed by third-party platforms like Apple App Store
376377
and Google Play Store.
378+
- name: business_entities
379+
x-displayName: Business Entities
380+
description: Describes the business address that will be used for invoices and taxes
381+
depending on settings and subscriber location.
377382
paths:
378383
"/sites":
379384
get:
@@ -15974,6 +15979,60 @@ paths:
1597415979
schema:
1597515980
"$ref": "#/components/schemas/Error"
1597615981
x-code-samples: []
15982+
"/business_entities/{business_entity_id}":
15983+
parameters:
15984+
- "$ref": "#/components/parameters/business_entity_id"
15985+
get:
15986+
tags:
15987+
- business_entities
15988+
operationId: get_business_entity
15989+
summary: Fetch a business entity
15990+
responses:
15991+
'200':
15992+
description: Business entity details
15993+
content:
15994+
application/json:
15995+
schema:
15996+
"$ref": "#/components/schemas/BusinessEntity"
15997+
'404':
15998+
description: Incorrect site or business entity ID.
15999+
content:
16000+
application/json:
16001+
schema:
16002+
"$ref": "#/components/schemas/Error"
16003+
default:
16004+
description: Unexpected error.
16005+
content:
16006+
application/json:
16007+
schema:
16008+
"$ref": "#/components/schemas/Error"
16009+
x-code-samples: []
16010+
"/business_entities":
16011+
get:
16012+
tags:
16013+
- business_entities
16014+
operationId: list_business_entities
16015+
summary: List business entities
16016+
responses:
16017+
'200':
16018+
description: List of all business entities on your site.
16019+
content:
16020+
application/json:
16021+
schema:
16022+
"$ref": "#/components/schemas/BusinessEntityList"
16023+
'404':
16024+
description: Incorrect site.
16025+
content:
16026+
application/json:
16027+
schema:
16028+
"$ref": "#/components/schemas/Error"
16029+
default:
16030+
description: Unexpected error.
16031+
content:
16032+
application/json:
16033+
schema:
16034+
"$ref": "#/components/schemas/Error"
16035+
x-code-samples: []
1597716036
"/gift_cards":
1597816037
get:
1597916038
tags:
@@ -16143,6 +16202,49 @@ paths:
1614316202
schema:
1614416203
"$ref": "#/components/schemas/Error"
1614516204
x-code-samples: []
16205+
"/business_entities/{business_entity_id}/invoices":
16206+
get:
16207+
tags:
16208+
- invoice
16209+
operationId: list_business_entity_invoices
16210+
summary: List a business entity's invoices
16211+
description: See the [Pagination Guide](/developers/guides/pagination.html)
16212+
to learn how to use pagination in the API and Client Libraries.
16213+
parameters:
16214+
- "$ref": "#/components/parameters/business_entity_id"
16215+
- "$ref": "#/components/parameters/ids"
16216+
- "$ref": "#/components/parameters/limit"
16217+
- "$ref": "#/components/parameters/order"
16218+
- "$ref": "#/components/parameters/sort_dates"
16219+
- "$ref": "#/components/parameters/filter_begin_time"
16220+
- "$ref": "#/components/parameters/filter_end_time"
16221+
- "$ref": "#/components/parameters/filter_invoice_type"
16222+
responses:
16223+
'200':
16224+
description: A list of the business entity's invoices.
16225+
content:
16226+
application/json:
16227+
schema:
16228+
"$ref": "#/components/schemas/InvoiceList"
16229+
'400':
16230+
description: Invalid or unpermitted parameter.
16231+
content:
16232+
application/json:
16233+
schema:
16234+
"$ref": "#/components/schemas/Error"
16235+
'404':
16236+
description: Incorrect site or business entity ID.
16237+
content:
16238+
application/json:
16239+
schema:
16240+
"$ref": "#/components/schemas/Error"
16241+
default:
16242+
description: Unexpected error.
16243+
content:
16244+
application/json:
16245+
schema:
16246+
"$ref": "#/components/schemas/Error"
16247+
x-code-samples: []
1614616248
servers:
1614716249
- url: https://v3.recurly.com
1614816250
- url: https://v3.eu.recurly.com
@@ -16180,6 +16282,14 @@ components:
1618016282
required: true
1618116283
schema:
1618216284
type: string
16285+
business_entity_id:
16286+
name: business_entity_id
16287+
in: path
16288+
description: Business Entity ID. For ID no prefix is used e.g. `e28zov4fw0v2`.
16289+
For code use prefix `code-`, e.g. `code-entity1`.
16290+
required: true
16291+
schema:
16292+
type: string
1618316293
usage_id:
1618416294
name: usage_id
1618516295
in: path
@@ -17101,6 +17211,11 @@ components:
1710117211
merchant has an integration for the Vertex tax provider, this optional
1710217212
value will be sent in any tax calculation requests for the account.
1710317213
maxLength: 30
17214+
override_business_entity_id:
17215+
type: string
17216+
title: Override Business Entity ID
17217+
description: Unique ID to identify the business entity assigned to the account.
17218+
Available when the `Multiple Business Entities` feature is enabled.
1710417219
parent_account_code:
1710517220
type: string
1710617221
maxLength: 50
@@ -17169,6 +17284,11 @@ components:
1716917284
The customer will also use this email address to log into your hosted
1717017285
account management pages. This value does not need to be unique.
1717117286
maxLength: 255
17287+
override_business_entity_id:
17288+
type: string
17289+
title: Override Business Entity ID
17290+
description: Unique ID to identify the business entity assigned to the account.
17291+
Available when the `Multiple Business Entities` feature is enabled.
1717217292
preferred_locale:
1717317293
description: Used to determine the language and locale of emails sent on
1717417294
behalf of the merchant to the customer.
@@ -19358,6 +19478,11 @@ components:
1935819478
type: boolean
1935919479
title: Final Dunning Event
1936019480
description: Last communication attempt.
19481+
business_entity_id:
19482+
type: string
19483+
title: Business Entity ID
19484+
description: Unique ID to identify the business entity assigned to the invoice.
19485+
Available when the `Multiple Business Entities` feature is enabled.
1936119486
InvoiceCreate:
1936219487
type: object
1936319488
properties:
@@ -23939,6 +24064,84 @@ components:
2393924064
type: string
2394024065
description: Username of the associated payment method. Currently only associated
2394124066
with Venmo.
24067+
BusinessEntityList:
24068+
type: object
24069+
properties:
24070+
object:
24071+
type: string
24072+
title: Object type
24073+
description: Will always be List.
24074+
has_more:
24075+
type: boolean
24076+
description: Indicates there are more results on subsequent pages.
24077+
next:
24078+
type: string
24079+
description: Path to subsequent page of results.
24080+
data:
24081+
type: array
24082+
items:
24083+
"$ref": "#/components/schemas/BusinessEntity"
24084+
BusinessEntity:
24085+
type: object
24086+
description: Business entity details
24087+
properties:
24088+
id:
24089+
title: Business entity ID
24090+
type: string
24091+
maxLength: 13
24092+
readOnly: true
24093+
object:
24094+
title: Object type
24095+
type: string
24096+
readOnly: true
24097+
code:
24098+
title: Business entity code
24099+
type: string
24100+
maxLength: 50
24101+
description: The entity code of the business entity.
24102+
name:
24103+
type: string
24104+
title: Name
24105+
description: This name describes your business entity and will appear on
24106+
the invoice.
24107+
maxLength: 255
24108+
invoice_display_address:
24109+
title: Invoice display address
24110+
description: Address information for the business entity that will appear
24111+
on the invoice.
24112+
"$ref": "#/components/schemas/Address"
24113+
tax_address:
24114+
title: Tax address
24115+
description: Address information for the business entity that will be used
24116+
for calculating taxes.
24117+
"$ref": "#/components/schemas/Address"
24118+
default_vat_number:
24119+
type: string
24120+
title: Default VAT number
24121+
description: VAT number for the customer used on the invoice.
24122+
maxLength: 20
24123+
default_registration_number:
24124+
type: string
24125+
title: Default registration number
24126+
description: Registration number for the customer used on the invoice.
24127+
maxLength: 30
24128+
subscriber_location_countries:
24129+
type: array
24130+
title: Subscriber location countries
24131+
description: List of countries for which the business entity will be used.
24132+
items:
24133+
type: string
24134+
title: Country code
24135+
created_at:
24136+
type: string
24137+
format: date-time
24138+
title: Created at
24139+
readOnly: true
24140+
updated_at:
24141+
type: string
24142+
format: date-time
24143+
title: Last updated at
24144+
readOnly: true
2394224145
GiftCardList:
2394324146
type: object
2394424147
properties:

recurly/client.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5109,6 +5109,44 @@ def list_account_external_subscriptions(self, account_id, **options):
51095109
path = self._interpolate_path("/accounts/%s/external_subscriptions", account_id)
51105110
return Pager(self, path, **options)
51115111

5112+
def get_business_entity(self, business_entity_id, **options):
5113+
"""Fetch a business entity
5114+
5115+
Parameters
5116+
----------
5117+
5118+
business_entity_id : str
5119+
Business Entity ID. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-entity1`.
5120+
5121+
Keyword Arguments
5122+
-----------------
5123+
5124+
headers : dict
5125+
Extra HTTP headers to send with the request.
5126+
5127+
Returns
5128+
-------
5129+
5130+
BusinessEntity
5131+
Business entity details
5132+
"""
5133+
path = self._interpolate_path("/business_entities/%s", business_entity_id)
5134+
return self._make_request("GET", path, None, **options)
5135+
5136+
def list_business_entities(self, **options):
5137+
"""List business entities
5138+
5139+
Returns
5140+
-------
5141+
5142+
Pager
5143+
List of all business entities on your site.
5144+
"""
5145+
path = self._interpolate_path(
5146+
"/business_entities",
5147+
)
5148+
return Pager(self, path, **options)
5149+
51125150
def list_gift_cards(self, **options):
51135151
"""List gift cards
51145152
@@ -5224,3 +5262,63 @@ def redeem_gift_card(self, redemption_code, body, **options):
52245262
"""
52255263
path = self._interpolate_path("/gift_cards/%s/redeem", redemption_code)
52265264
return self._make_request("POST", path, body, **options)
5265+
5266+
def list_business_entity_invoices(self, business_entity_id, **options):
5267+
"""List a business entity's invoices
5268+
5269+
Parameters
5270+
----------
5271+
5272+
business_entity_id : str
5273+
Business Entity ID. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-entity1`.
5274+
5275+
Keyword Arguments
5276+
-----------------
5277+
5278+
headers : dict
5279+
Extra HTTP headers to send with the request.
5280+
params : dict
5281+
Query Parameters.
5282+
params.ids : :obj:`list` of :obj:`str`
5283+
Filter results by their IDs. Up to 200 IDs can be passed at once using
5284+
commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
5285+
5286+
**Important notes:**
5287+
5288+
* The `ids` parameter cannot be used with any other ordering or filtering
5289+
parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
5290+
* Invalid or unknown IDs will be ignored, so you should check that the
5291+
results correspond to your request.
5292+
* Records are returned in an arbitrary order. Since results are all
5293+
returned at once you can sort the records yourself.
5294+
params.limit : int
5295+
Limit number of records 1-200.
5296+
params.order : str
5297+
Sort order.
5298+
params.sort : str
5299+
Sort field. You *really* only want to sort by `updated_at` in ascending
5300+
order. In descending order updated records will move behind the cursor and could
5301+
prevent some records from being returned.
5302+
params.begin_time : datetime
5303+
Inclusively filter by begin_time when `sort=created_at` or `sort=updated_at`.
5304+
**Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
5305+
params.end_time : datetime
5306+
Inclusively filter by end_time when `sort=created_at` or `sort=updated_at`.
5307+
**Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
5308+
params.type : str
5309+
Filter by type when:
5310+
- `type=charge`, only charge invoices will be returned.
5311+
- `type=credit`, only credit invoices will be returned.
5312+
- `type=non-legacy`, only charge and credit invoices will be returned.
5313+
- `type=legacy`, only legacy invoices will be returned.
5314+
5315+
Returns
5316+
-------
5317+
5318+
Pager
5319+
A list of the business entity's invoices.
5320+
"""
5321+
path = self._interpolate_path(
5322+
"/business_entities/%s/invoices", business_entity_id
5323+
)
5324+
return Pager(self, path, **options)

0 commit comments

Comments
 (0)