Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

PowerBuilder Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
JCC Cyprus
Jira
Lightspeed
MYOB
Magento
Mailgun
Malaysia MyInvois

Mastercard
MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
Salesforce
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
TikTok Shop
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(PowerBuilder) Amazon MWS Upload Invoice

Demonstrates how to upload an invoice using _UPLOAD_VAT_INVOICE_FeedType to submit an invoice for an order.

For more information, see https://m.media-amazon.com/images/G/03/B2B/invoice-uploader-developer-documentation.pdf

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

integer li_rc
integer li_Success
oleobject loo_Rest
integer li_BTls
integer li_Port
integer li_BAutoReconnect
oleobject loo_PdfData
oleobject loo_Crypt
string ls_Md5Hash
oleobject loo_SbResponseBody

// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loo_Rest = create oleobject
// Use "Chilkat_9_5_0.Rest" for versions of Chilkat < 10.0.0
li_rc = loo_Rest.ConnectToNewObject("Chilkat.Rest")
if li_rc < 0 then
    destroy loo_Rest
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// Connect to the Amazon MWS REST server.
// 
// Make sure to connect to the correct Amazon MWS Endpoint, otherwise
// you'll get an HTTP 401 response code.
// 
// See Amazon MWS endpoints and MarketplaceId values

li_BTls = 1
li_Port = 443
li_BAutoReconnect = 1
li_Success = loo_Rest.Connect("mws.amazonservices.com",li_Port,li_BTls,li_BAutoReconnect)

loo_Rest.Host = "mws.amazonservices.com"

// MarketplaceList.Id parameter �This should be the marketplace in which the order was placed. Only one marketplace must be used per order.T
// Here are the marketplace ID's
// Spain: A1RKKUPIHCS9HS
// UK: A1F83G8C2ARO7P
// France: A13V1IB3VIYZZH
// Germany: A1PA6795UKMFR9
// Italy: APJ6JRA9NG5V4
// ...
// (See https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html)

// FeedOptions parameter � Seller can input key value pairs to give important metadata along with the PDF invoice.
loo_Rest.AddQueryParam("FeedOptions","metadata:orderid=206-2341234-3455465;metadata:invoicenumber=INT-3431-XJE3;metadata:documenttype=Invoice")

// Load the PDF invoice file that is to be the body of the HTTP POST request.
loo_PdfData = create oleobject
// Use "Chilkat_9_5_0.BinData" for versions of Chilkat < 10.0.0
li_rc = loo_PdfData.ConnectToNewObject("Chilkat.BinData")

li_Success = loo_PdfData.LoadFile("qa_data/pdf/sample.pdf")

// Get the MD5 hash of the PDF data.
loo_Crypt = create oleobject
// Use "Chilkat_9_5_0.Crypt2" for versions of Chilkat < 10.0.0
li_rc = loo_Crypt.ConnectToNewObject("Chilkat.Crypt2")

loo_Crypt.HashAlgorithm = "md5"
loo_Crypt.EncodingMode = "base64"
ls_Md5Hash = loo_Crypt.HashBdENC(loo_PdfData)

loo_Rest.AddQueryParam("AWSAccessKeyId","0PB842ExampleN4ZTR2")
loo_Rest.AddQueryParam("Action","SubmitFeed")
loo_Rest.AddQueryParam("FeedType","_UPLOAD_VAT_INVOICE_")
loo_Rest.AddQueryParam("MWSAuthToken","EXAMPLE-amzn.mws.4ea38b7b-f563-7709-4bae-87aea-EXAMPLE")

loo_Rest.AddQueryParam("MarketplaceIdList.Id.1","ATVExampleDER")
loo_Rest.AddQueryParam("SellerId","A1XExample5E6")
loo_Rest.AddQueryParam("ContentMD5Value",ls_Md5Hash)
loo_Rest.AddQueryParam("SignatureMethod","HmacSHA256")
loo_Rest.AddQueryParam("SignatureVersion","2")
loo_Rest.AddQueryParam("Version","2009-01-01")

// Add the MWS Signature param.  (Also adds the Timestamp parameter using the curent system date/time.)
loo_Rest.AddMwsSignature("POST","/Feeds/2009-01-01","mws.amazonservices.com","YOUR_MWS_SECRET_ACCESS_KEY_ID")

loo_Rest.AddHeader("Content-Type","application/octet-stream")
loo_SbResponseBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

li_Success = loo_Rest.FullRequestBd("POST","/Feeds/2009-01-01",loo_PdfData,loo_SbResponseBody)
if loo_Rest.LastMethodSuccess <> 1 then
    Write-Debug loo_Rest.LastErrorText
    destroy loo_Rest
    destroy loo_PdfData
    destroy loo_Crypt
    destroy loo_SbResponseBody
    return
end if

if loo_Rest.ResponseStatusCode <> 200 then
    // Examine the request/response to see what happened.
    Write-Debug "response status code = " + string(loo_Rest.ResponseStatusCode)
    Write-Debug "response status text = " + loo_Rest.ResponseStatusText
    Write-Debug "response header: " + loo_Rest.ResponseHeader
    Write-Debug "response body: " + loo_SbResponseBody.GetAsString()
    Write-Debug "---"
    Write-Debug "LastRequestStartLine: " + loo_Rest.LastRequestStartLine
    Write-Debug "LastRequestHeader: " + loo_Rest.LastRequestHeader
end if

// Examine the XML returned in the response body.
Write-Debug loo_SbResponseBody.GetAsString()
Write-Debug "----"
Write-Debug "Success."


destroy loo_Rest
destroy loo_PdfData
destroy loo_Crypt
destroy loo_SbResponseBody

 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.