Receipt

Each receipt is accessed via /api/receipt.

Properties

Complete details in OrderProperties and OrderItemProperties.

id

The unique id for this receipt. It will never change.

wing_object_type

receipt.

name

A label to identify an receipt. This is a holdover in case the cart or wishlist the receipt was created from was named.

order_number

A unique integer attached to this receipt. Used by support personnel to identify an receipt in case of trouble.

user_id

A User id. The unique id of the user attached to the receipt.

shipping_address_id

An Address id. The unique id of an address.

shipping_address

A hash of address properties associated with the shipping_address_id. See Receipt Related Objects below for details.

shipping_method

The shipping method being used to ship this order.

shipping_cost

The amount added to the receipt to account for the cost of shipping.

subtotal

The cost of all the items attached to the receipt before taxes, shop credit, and shipping are applied.

taxes

The amount of taxes to be paid to purchase this receipt.

total

The total cost of the receipt including taxes and shipping.

payment_method

The method used to pay for the receipt.

payment_transaction_id

If the payment method provided a transaction id it will be provided here.

payment_status

If the payment method provided a status code that will be provided here.

payment_message

If the payment method provided a status message that will be provided here.

ip_address

The IP address of the user at the time of receipt creation.

date_created

A date when the receipt was created.

date_updated

A date when the receipt's account was last updated.

refunded_amount

A dollar amount of credits applied to this receipt.

refunded

A boolean indicating that the entire order was marked refunded.

shop_credit_used

A dollar amount of shop credit applied to the total of this receipt.

grand_total

The total minus shop_credit_used minus refunded_amount.

notes

If an receipt has been held, or some adjustment needs to be made to an receipt, an admin will make a note of it here.

Relationships

See "Relationships" in Intro for details.

items

An array of items that are currently placed in the receipt

      "items" : [
         {
            "quantity" : "1",
            "name" : "Prison Break",
            "price_each" : "0.8900",
            "id" : "563C57FE-47F0-11E2-836F-50F9C28E391D"
            ...
         }
         ...
    ]

Please see Game and Part for more details about what items may contain.

shipments

An array of Shipments associated with this receipt.

The user attached to this cart, if any.

Related Objects

See "Related Objects" in Intro for details.

user

The User attached to this receipt. Will return:

 {
    "shop_credit" : "0.00",
    "username" : "andy",
    "id" : "xxx",
    ...
 }
shipping_address

The Address attached to the receipt that the receipt should be shipped to. Will return:

 {
    "id" : "xxx",
    "name" : "Andy Dufresne",
    "company" : "Shawshank Prison",
    "address1" : "123 Prison Lane",
    "address2" : "Shawshank Prison Library",
    "city" : "Portland",
    "state" : "Maine",
    "postal_code" : "04101",
    "country" : "US",
    "phone_number" : "207-874-8300"
 }

Includes

shipments

Returns a summary of Shipments associated with this receipt in the receipts data set rather than as a separate request in the Relationships above.

Receipt Methods

The methods used to fetch and manipulate receipts.

Fetch Receipt

 GET /api/receipt/xxx
session_id

Required. The unique session id provided by a Session method.

Returns:

 {
   "id" : "xxx",
   "order_number" : "4301",
   ...
 }

Restitch Receipt

 PUT /api/receipt/xxx
 action=Restitch

Order and production managers may request new manufacturing files with an optional message_to_customer. A verified queued, running, delayed, or retained stitching job prevents another Restitch with HTTP 409; the existing job, order history, and item progress are preserved. Inspect the existing work rather than resubmitting it. Once the job ends, reload the order page to request a deliberate new Restitch. The Restitch button shows the existing job state and is disabled while submitting or while that job exists. Failed retained work must be reviewed before retrying. An unfinished stitch plan also rejects Restitch with HTTP 409 before changing the order. If queue inspection fails, the order page remains usable, reports the error through its toast system, and disables Restitch until the service is available and the page is reloaded.

Cancel Receipt

 POST /api/receipt/xxx/cancel

Cancels the receipt and generates a refund to store credit. You must provide a reason for the cancellation.

session_id

Required. The unique session id provided by a Session method.

cancel_reason

Required. The reason this order is being cancelled. For example, "I want to make some changes to the order.", "I no longer want these items.", "The estimated ship date is too long."

Returns:

 {
   "success" : 1,
 }
^ Back to Top ^