Orders

Get an order

GET /order/193468423

Example JSON response

{
  "status": 200,
  "success": true,
  "data": {
    "id": 193468423,
    "customer_id": 449739128,
    "total": 34900,
    "total_with_vat": 43625,
    "currency": "sek",
    "reference_id": null,
    "reference_name": null,
    "state": "paid",
    "billing_method": {
      "email": "jane@snowfire.net",
      "type": "swish"
    },
    "items": [
      {
        "description": "Snowfire Website",
        "quantity": "1",
        "price": 34900,
        "vat": 2500,
        "product": {
          "id": 1225,
          "name": "Snowfire Website",
          "type": "month",
          "price": 34900,
          "currency": "sek",
          "vat_rate": 2500
        }
      }
    ],
    "customer": {
      "id": 449739128,
      "name": "Jane Doe",
      "type": "person",
      "vat_number": null,
      "archived_at": null,
      "person": {
        "first_name": "Jane",
        "last_name": "Doe",
        "email": "jane@snowfire.net",
        "phone": null,
        "locale": "sv"
      },
      "address": null
    }
  }
}

Create an order

You can create an order on an existing subscription. Depending on payment method it might be paid instantly, or the next bank day.

POST /order

Example request body:

{
  "subscription": "98453243",
  "rows": [
    {
      "description": "Example charge",
      "product_id": "1234",
      "vat": 2500,
      "quantity": 1,
      "amount": 20000
    }
  ]
}

Request Body Parameters:

Parameter Type Required Description
subscription int Yes The unique identifier of the subscription
rows array Yes Array of order row items

Order Row Object:

Field Type Required Description
description string Yes Description of the order item
product_id string Yes The unique identifier of the product
vat integer Yes VAT amount in basis points (e.g., 2500 = 25%)
quantity integer Yes Quantity of items
amount integer Yes Amount in smallest currency unit (e.g., cents)

Example response body:

{
  "data": {
    "reference": "ord_1234",
  }
}

The reference is ord followed by the order number for all payment providers except card. If it is a card payment you will get a reference like this str_in_1234. Currently you can't use card references to retrieve the order.

We recommend saving the reference in your database to make future support requests easier to follow.

Svarade detta på din fråga? Tack för din feedback Det var ett problem att skicka din feedback

Behöver du fortfarande hjälp? Kontakta oss Kontakta oss