Skip to content

Commit 81e161b

Browse files
DX Codefreshdouglasmiller
authored andcommitted
Generated Latest Changes for v2019-10-10
1 parent 6c382ea commit 81e161b

File tree

2 files changed

+113
-4
lines changed

2 files changed

+113
-4
lines changed

openapi/api.yaml

Lines changed: 109 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7881,6 +7881,8 @@ paths:
78817881
summary: Apply available credit to a pending or past due charge invoice
78827882
description: Apply credit payment to the outstanding balance on an existing
78837883
charge invoice from an account’s available balance from existing credit invoices.
7884+
Credit that was refunded from the invoice cannot be applied back to the invoice
7885+
as payment.
78847886
parameters:
78857887
- "$ref": "#/components/parameters/site_id"
78867888
- "$ref": "#/components/parameters/invoice_id"
@@ -7899,7 +7901,8 @@ paths:
78997901
"$ref": "#/components/schemas/Error"
79007902
'422':
79017903
description: Tried applying credit to a legacy or closed invoice or there
7902-
was an error processing the credit payment.
7904+
was an error processing the credit payment, such as no available credit
7905+
on the account.
79037906
content:
79047907
application/json:
79057908
schema:
@@ -7910,7 +7913,95 @@ paths:
79107913
application/json:
79117914
schema:
79127915
"$ref": "#/components/schemas/Error"
7913-
x-code-samples: []
7916+
x-code-samples:
7917+
- lang: Node.js
7918+
source: |
7919+
try {
7920+
const invoice = await client.applyCreditBalance(invoiceId)
7921+
console.log('Applied credit balance to invoice: ', invoice)
7922+
} catch (err) {
7923+
if (err instanceof recurly.errors.ValidationError) {
7924+
// If the request was not valid, you may want to tell your user
7925+
// why. You can find the invalid params and reasons in err.params
7926+
console.log('Failed validation', err.params)
7927+
} else {
7928+
// If we don't know what to do with the err, we should
7929+
// probably re-raise and let our web framework and logger handle it
7930+
console.log('Unknown Error: ', err)
7931+
}
7932+
}
7933+
- lang: Python
7934+
source: |
7935+
try:
7936+
invoice = client.apply_credit_balance(invoice_id)
7937+
print("Applied credit balance to invoice %s" % invoice.id)
7938+
except recurly.errors.NotFoundError:
7939+
# If the resource was not found, you may want to alert the user or
7940+
# just return nil
7941+
print("Resource Not Found")
7942+
- lang: ".NET"
7943+
source: |
7944+
try
7945+
{
7946+
Invoice invoice = client.ApplyCreditBalance(invoiceId);
7947+
Console.WriteLine($"Applied credit balance to invoice #{invoice.Number}");
7948+
}
7949+
catch (Recurly.Errors.Validation ex)
7950+
{
7951+
// If the request was not valid, you may want to tell your user
7952+
// why. You can find the invalid params and reasons in ex.Error.Params
7953+
Console.WriteLine($"Failed validation: {ex.Error.Message}");
7954+
}
7955+
catch (Recurly.Errors.ApiError ex)
7956+
{
7957+
// Use ApiError to catch a generic error from the API
7958+
Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}");
7959+
}
7960+
- lang: Ruby
7961+
source: |
7962+
begin
7963+
invoice = @client.apply_credit_balance(invoice_id: invoice_id)
7964+
puts "Applied credit balance to invoice #{invoice}"
7965+
rescue Recurly::Errors::NotFoundError
7966+
# If the resource was not found, you may want to alert the user or
7967+
# just return nil
7968+
puts "Resource Not Found"
7969+
end
7970+
- lang: Java
7971+
source: |
7972+
try {
7973+
final Invoice invoice = client.applyCreditBalance(invoiceId);
7974+
System.out.println("Applied credit balance to invoice " + invoice.getId());
7975+
} catch (final ValidationException e) {
7976+
// If the request was not valid, you may want to tell your user
7977+
// why. You can find the invalid params and reasons in e.getError().getParams()
7978+
System.out.println("Failed validation: " + e.getError().getMessage());
7979+
} catch (final ApiException e) {
7980+
// Use ApiException to catch a generic error from the API
7981+
System.out.println("Unexpected Recurly Error: " + e.getError().getMessage());
7982+
}
7983+
- lang: PHP
7984+
source: |
7985+
try {
7986+
$invoice = $client->applyCreditBalance($invoice_id);
7987+
7988+
echo 'Applied credit balance to invoice:' . PHP_EOL;
7989+
var_dump($invoice);
7990+
} catch (\Recurly\Errors\Validation $e) {
7991+
// If the request was not valid, you may want to tell your user
7992+
// why. You can find the invalid params and reasons in err.params
7993+
var_dump($e);
7994+
} catch (\Recurly\RecurlyError $e) {
7995+
// If we don't know what to do with the err, we should
7996+
// probably re-raise and let our web framework and logger handle it
7997+
var_dump($e);
7998+
}
7999+
- lang: Go
8000+
source: "invoice, err := client.ApplyCreditBalance(invoiceID)\nif e, ok :=
8001+
err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed
8002+
validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
8003+
Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Applied credit
8004+
balance to invoice: %v\", invoice)"
79148005
"/sites/{site_id}/invoices/{invoice_id}/collect":
79158006
put:
79168007
tags:
@@ -15480,6 +15571,11 @@ components:
1548015571
- sv-SE
1548115572
- tr-TR
1548215573
- zh-CN
15574+
preferred_time_zone:
15575+
type: string
15576+
example: America/Los_Angeles
15577+
description: Used to determine the time zone of emails sent on behalf of
15578+
the merchant to the customer. Must be a [supported IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
1548315579
cc_emails:
1548415580
type: string
1548515581
description: Additional email address that should receive account correspondence.
@@ -15612,6 +15708,12 @@ components:
1561215708
- sv-SE
1561315709
- tr-TR
1561415710
- zh-CN
15711+
preferred_time_zone:
15712+
type: string
15713+
example: America/Los_Angeles
15714+
description: The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
15715+
used to determine the time zone of emails sent on behalf of the merchant
15716+
to the customer.
1561515717
cc_emails:
1561615718
type: string
1561715719
description: Additional email address that should receive account correspondence.
@@ -17764,7 +17866,11 @@ components:
1776417866
type: string
1776517867
title: Previous invoice ID
1776617868
description: On refund invoices, this value will exist and show the invoice
17767-
ID of the purchase invoice the refund was created from.
17869+
ID of the purchase invoice the refund was created from. This field is
17870+
only populated for sites without the [Only Bill What Changed](https://docs.recurly.com/docs/only-bill-what-changed)
17871+
feature enabled. Sites with Only Bill What Changed enabled should use
17872+
the [related_invoices endpoint](https://recurly.com/developers/api/v2019-10-10/index.html#operation/list_related_invoices)
17873+
to see purchase invoices refunded by this invoice.
1776817874
maxLength: 13
1776917875
number:
1777017876
type: string

recurly/resources.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ class Account(Resource):
172172
The UUID of the parent account associated with this account.
173173
preferred_locale : str
174174
Used to determine the language and locale of emails sent on behalf of the merchant to the customer.
175+
preferred_time_zone : str
176+
The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names) used to determine the time zone of emails sent on behalf of the merchant to the customer.
175177
shipping_addresses : :obj:`list` of :obj:`ShippingAddress`
176178
The shipping addresses on the account.
177179
state : str
@@ -212,6 +214,7 @@ class Account(Resource):
212214
"object": str,
213215
"parent_account_id": str,
214216
"preferred_locale": str,
217+
"preferred_time_zone": str,
215218
"shipping_addresses": ["ShippingAddress"],
216219
"state": str,
217220
"tax_exempt": bool,
@@ -1134,7 +1137,7 @@ class Invoice(Resource):
11341137
po_number : str
11351138
For manual invoicing, this identifies the PO number associated with the subscription.
11361139
previous_invoice_id : str
1137-
On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from.
1140+
On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from. This field is only populated for sites without the [Only Bill What Changed](https://docs.recurly.com/docs/only-bill-what-changed) feature enabled. Sites with Only Bill What Changed enabled should use the [related_invoices endpoint](https://recurly.com/developers/api/v2019-10-10/index.html#operation/list_related_invoices) to see purchase invoices refunded by this invoice.
11381141
refundable_amount : float
11391142
The refundable amount on a charge invoice. It will be null for all other invoices.
11401143
shipping_address : ShippingAddress

0 commit comments

Comments
 (0)