The pay/getInvoice method is an Elance Developer API Pay method that returns information on a specific invoice.

pay/getInvoice returns only summary information for an invoice. To retrieve all related data (such as invoice activity and payments) in a single request, use the pay/getBilling method instead.

pay/getInvoice is an authenticated method. It requires a Developer API key and an OAuth Consumer Secret, both issued by Elance. It is invoked using an HTTP or HTTPS GET request. For more details on the OAuth authentication protocol, see Using OAuth with Authenticated Methods.

This method does not support the JSONP response format.

For more information on the format of an Elance Developer API request, see Getting Started.

tableofcontents_number_textRequired Query String Parameters

Parameter Data Type Description
id integer The unique ID, assigned by Elance, to the requested invoice object.

tableofcontents_number_textResponse Data Description

Property Data Type Description
bidDetails BidData object The details regarding this bid and associated Workroom, including project name, client, and provider.
invoice InvoiceData object Basic information about the invoice, including the amount billed and the currency used.

tableofcontents_number_textRequest/Response Examples in JSON

tableofcontents_number_textRetrieving an Invoice

The following HTTP GET request demonstrates retrieving a specific invoice using its invoice ID. The HTTP headers for the GET request are shown below. (NOTE: Elance recommends that developers access OAuth APIs using one of the many publicly available libraries.)

tableofcontents_number_textRequest

GET /api/pay/getInvoice?id=6730313 HTTP/1.1
User-Agent: anyMeta/OAuth 1.0 - ($LastChangedRevision: 134 $)
Host: api.elance.com
Accept: */*
Authorization: OAuth realm="",oauth_signature_method="HMAC-SHA1",oauth_signature="YHpUKkLbUI6B%2B%2BUwY54rFpml2wk%3D",oauth_nonce="4c8bba92d8a91",oauth_timestamp="1284225682",oauth_token="988078256-1425962-1425962-76.99.193-fd76b324028bef6-%2B",oauth_consumer_key="8cfc475b57fee5b7dc08cc0f1d5a0fcdab409b3c",oauth_version="1.0"

tableofcontents_number_textResponse

{
    "api" : "pay\/getBilling",
    "apiVersion" : 1,
    "rcode" : 1,
    "data" :  {
        "bidDetails" :  {
            "bidId" : "24170489",
            "jobId" : "24170488",
            "jobName" : "PHP scripting for SuperGeeks",
            "userType" : "PROVIDER",
            "clientUserId" : "1969228",
            "clientName" : "SuperGeeks",
            "clientImageURL" : "https : \/\/www.elance.com\/file\/SG_logo100x100.jpg?crypted=Y3R4JTNEc2VhcmNoX3RodW1ibmFpbCUyNmZpZCUzRDIwMzEwMTczJTI2cmlkJTNELTElMjZwaWQlM0QxOTY5MjI4",
            "clientCountry" : "United States",
            "clientCountryCode" : "US",
            "clientCity" : "Honolulu",
            "providerUserId" : "1976925",
            "providerName" : "John Smith",
            "providerImageURL" : "https : \/\/www.elance.com\/file\/cry_face_4056.jpg?crypted=Y3R4JTNEc2VhcmNoX3RodW1ibmFpbCUyNmZpZCUzRDMwMTAxODEyJTI2cmlkJTNELTElMjZwaWQlM0QxOTc2OTI1",
            "providerCountry" : "United States",
            "providerCountryCode" : "US",
            "providerCity" : "Mountain View",
            "phase" : "5",
            "status" : "Working",
            "secondaryStatus" : "",
            "isHourly" : false,
            "isSponsored" : false,
            "isPreBid" : false,
            "bidAmount" : "200",
            "hoursPerWeek" : "0",
            "duration" : "",
            "submissionDate" : 1306900800
        },
        "invoice" :  {
            "id" : 6730313,
            "date" : 1306900800,
            "bidId" : 24170489,
            "jobId" : 24170488,
            "client" : "SuperGeeks",
            "provider" : "johnsmithinc",
            "clientUserId" : 1969228,
            "providerUserId" : 1976925,
            "type" : "Invoice",
            "status" : "Released",
            "amountBilled" : 200,
            "amountPaid" : 200,
            "amountOutstanding" : 0,
            "currency" : "USD",
            "comments" : "",
            "lineItemCount" : 0,
            "paymentIds" : [10396168]
        }
    }
} 

tableofcontents_number_textError Codes

For a list of other common errors that can be thrown by this method, see Common API Error Codes.