Transactions API

for owner

GET /api/v1/transactions/:transaction_id

Parameters

Name Description
student_id student id
sale_id sale id
transaction_id transaction id
amount amount

Request

Headers

Accept: application/json
X-Api-Token: NumqkCVSkNPsQD_1uwggSGfqWbsw5QrYyw
X-Api-Email: user-1@example.com

Route

GET /api/v1/transactions/1?student_id=3&sale_id=1

Query Parameters

student_id: 3
sale_id: 1

cURL

curl "http://localhost:3000/api/v1/transactions/1?student_id=3&sale_id=1" -X GET \
	-H "Accept: application/json" \
	-H "X-Api-Token: NumqkCVSkNPsQD_1uwggSGfqWbsw5QrYyw" \
	-H "X-Api-Email: user-1@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 3459

Status

200 OK

Body

{
  "created_at": "2019-10-31T22:01:22Z",
  "failure_reason": null,
  "custom_gateway?": false,
  "fully_refunded?": false,
  "is_stripe_connect?": false,
  "is_custom_paypal?": false,
  "is_teachable_payments?": false,
  "charged_back_at": null,
  "reserves": [

  ],
  "user_id": 3,
  "final_price": 1000,
  "currency": "USD",
  "affiliate_percent": 0.0,
  "author_percent": 0.0,
  "author_id": null,
  "teachable_percent": 0.05,
  "teachable_processor_fee": null,
  "amount_refunded": 0,
  "status": "paid",
  "affiliate_fees": 0,
  "author_fees": 0,
  "sale_id": 1,
  "coupon_id": null,
  "net_charge": 1000,
  "earnings_usd": null,
  "net_charge_usd": null,
  "teachable_fixed_fee": 0,
  "total_teachable_fee": null,
  "teachable_gateway_fee": null,
  "is_recurring": false,
  "stripe_charge_token": "ch_CFgNel8yrQkZ33",
  "paypal_payment_id": null,
  "stripe_invoice_id": null,
  "purchased_at": "2019-10-31T22:01:22Z",
  "refundable": true,
  "vat_fees": null,
  "is_chargeback": null,
  "id": 1,
  "net_tax_charge": 0,
  "original_product_charge_usd": null,
  "net_product_charge_usd": null,
  "marketplace_affiliate_id": null,
  "marketplace_affiliate_percent": null,
  "marketplace_affiliate_fees": 0,
  "marketplace_teachable_fees": 0,
  "marketplace_teachable_percent": null,
  "chargeback_fee": null,
  "back_office_fee_percent": "0.0",
  "back_office_fee": null,
  "fee_details": null,
  "meta": {
    "class": "transaction",
    "url": null,
    "name": "1",
    "description": "",
    "image_url": null
  },
  "user": {
    "created_at": "2019-10-31T22:01:22Z",
    "role": "student",
    "sanitized_name": "User Name",
    "gravatar_url": "https://s.gravatar.com/avatar/cdd723a3c6b4599704b8ed02339b2e80?d=mm",
    "is_teachable_account": false,
    "author_bio": null,
    "author_bio_id": null,
    "custom_role": null,
    "custom_role_name": null,
    "primary_owner?": false,
    "show_custom_role_upgrade?": false,
    "email": "user-2@example.com",
    "notes": null,
    "affiliate_code": "1_4xhes0os",
    "name": "User Name",
    "is_owner": false,
    "sign_in_count": 0,
    "is_student": true,
    "is_affiliate": false,
    "is_author": false,
    "src": null,
    "current_sign_in_at": null,
    "last_four": null,
    "paypal_email": null,
    "affiliate_revenue_share": null,
    "joined_at": "2019-10-31T22:01:22Z",
    "signed_up_affiliate_code": null,
    "author_revenue_share": 0.0,
    "last_sign_in_ip": null,
    "current_sign_in_ip": null,
    "id": 3,
    "school_id": 1,
    "teachable_account_id": null,
    "is_staff_user": null,
    "agree_updated_privacy_policy": true,
    "unsubscribe_from_marketing_emails": null,
    "meta": {
      "class": "user",
      "url": null,
      "name": "User Name",
      "description": "",
      "image_url": null
    },
    "transactions_gross": 0
  },
  "affiliate": null,
  "coupon": null,
  "product": {
    "created_at": "2019-10-31T22:01:22Z",
    "formatted_price": "$10",
    "name": "product name",
    "description": "product description",
    "billing_interval": "month",
    "detailed_description": null,
    "currency": "USD",
    "position": 1,
    "price": 1000,
    "is_recurring": false,
    "is_published": true,
    "course_id": 1,
    "author_revenue_share": null,
    "num_payments_required": null,
    "id": 1,
    "meta": {
      "class": "product",
      "url": "/courses/1/products/1",
      "name": "product name",
      "description": "product description",
      "image_url": null
    }
  },
  "sale": {
    "created_at": "2019-10-31T22:01:22Z",
    "vat_rate": 0.0,
    "subscription_amount_to_bill": 1000,
    "subscription_status": "active",
    "product_id": 1,
    "user_id": 3,
    "is_active": true,
    "current_period_start": null,
    "current_period_end": null,
    "is_recurring": false,
    "currency": "USD",
    "payment_method": "stripe",
    "purchased_at": "2019-10-31T22:01:22Z",
    "country": null,
    "next_period_start": null,
    "num_payments_required": null,
    "fully_paid_plan": null,
    "vat_tax_id": null,
    "id": 1,
    "meta": {
      "class": "sale",
      "url": "/sales/1",
      "name": "1",
      "description": "",
      "image_url": null
    }
  },
  "course": {
    "name": "Course Name 0",
    "id": 1
  },
  "tax_record": null,
  "stripe_payouts": [

  ],
  "earnings_adjustments": [

  ]
}