Dashboard ↗

You can pass a resource's id to the find() function to fetch the data for that resource. You may need to store the id strings of important objects in your database for easy access. For example, you might keep the ID of a Customer object along with the user's username and password so you can easily fetch the object after the user logs in.

curl https://api.processout.com/invoices/iv_0kJ1i4d06uViosJjCKpUHzKeauffMom4 \
    -u test-proj_gAO1Uu0ysZJvDuUpOGPkUBeE3pGalk3x:key_sandbox_mah31RDFqcDxmaS7MvhDbJfDJvjtsFTB
var ProcessOut = require("processout");
var client = new ProcessOut(
    "test-proj_gAO1Uu0ysZJvDuUpOGPkUBeE3pGalk3x",
    "key_sandbox_mah31RDFqcDxmaS7MvhDbJfDJvjtsFTB");

client.newInvoice().find("iv_0kJ1i4d06uViosJjCKpUHzKeauffMom4").then(
    function(invoice) {
        // Invoice was fetched
    }, function(err) {
        // An error occured
    });
import processout
client = processout.ProcessOut(
    "test-proj_gAO1Uu0ysZJvDuUpOGPkUBeE3pGalk3x", 
    "key_sandbox_mah31RDFqcDxmaS7MvhDbJfDJvjtsFTB")

customer = client.new_invoice().find("iv_0kJ1i4d06uViosJjCKpUHzKeauffMom4")
require "processout"
client = ProcessOut::Client.new(
    "test-proj_gAO1Uu0ysZJvDuUpOGPkUBeE3pGalk3x", 
    "key_sandbox_mah31RDFqcDxmaS7MvhDbJfDJvjtsFTB")

customer = client.invoice.find("iv_0kJ1i4d06uViosJjCKpUHzKeauffMom4")
<?php
$client = new \ProcessOut\ProcessOut(
    "test-proj_gAO1Uu0ysZJvDuUpOGPkUBeE3pGalk3x", 
    "key_sandbox_mah31RDFqcDxmaS7MvhDbJfDJvjtsFTB");

$customer = $client->newInvoice()->find("iv_0kJ1i4d06uViosJjCKpUHzKeauffMom4");
import "github.com/processout/processout-go"

var client = processout.New(
    "test-proj_gAO1Uu0ysZJvDuUpOGPkUBeE3pGalk3x", 
    "key_sandbox_mah31RDFqcDxmaS7MvhDbJfDJvjtsFTB",
)

cust, err := client.NewInvoice().Find("iv_0kJ1i4d06uViosJjCKpUHzKeauffMom4")

You can see here that the response from find() is the same object that was created previously.

{
    "invoice": {
        "id": "iv_0kJ1i4d06uViosJjCKpUHzKeauffMom4",
        "project_id": "proj_gAO1Uu0ysZJvDuUpOGPkUBeE3pGalk3x",
        "subscription_id": null,
        "customer_id": "cust_CgdhFgj5QEv5I8dx6tHxVVrgxBDDzAgc",
        "token_id": null,
        "details": null,
        "transaction_id": "tr_qQI20QnTYPXK1MALJNfkOCjK8nycUObl",
        "name": "Amazing item",
        "amount": "4.99",
        "currency": "AUD",
        "order_id": "000001",
        .
        .
}