Daftra API
DocsAll EndpointsDaftra Partners
DocsAll EndpointsDaftra Partners
  1. Purchase Refunds
  • Welcome
  • Getting Started
  • Authorization
  • authorization
    • Authenticate
      POST
  • Invoices
    • GET Single Invoice
      GET
    • Edit Invoices
      PUT
    • Delete Invoices
      DELETE
    • GET All Invoices
      GET
    • Add New Invoice
      POST
  • Estimates
    • GET Single Estimate
      GET
    • Edit Estimates
      PUT
    • Delete Estimates
      DELETE
    • GET All Estimates
      GET
    • Add New Estimate
      POST
  • Credit Notes
    • GET Single Credit Note
      GET
    • Edit Credit Notes
      PUT
    • Delete Credit Notes
      DELETE
    • GET All Credit Notes
      GET
    • Add New Credit Note
      POST
  • Refund Receipts
    • GET Single Refund Receipt
      GET
    • Edit Refund Receipts
      PUT
    • Delete Refund Receipts
      DELETE
    • GET All Refund Receipts
      GET
    • Add New Refund Receipt
      POST
  • Clients
    • GET Single Client
    • Edit Clients
    • Delete Clients
    • GET All Clients
    • Add New Client
  • Suppliers
    • GET Single Supplier
    • Edit Suppliers
    • Delete Suppliers
    • GET All Suppliers
    • Add New Supplier
  • Work Orders
    • GET Single Work Order
    • Edit Work Orders
    • Delete Work Orders
    • GET All Work Orders
    • Add New Work Order
  • Client Appointments
    • GET Single Client Appointment
    • Edit Client Appointments
    • Delete Client Appointments
    • GET All Client Appointments
    • Add New Client Appointment
  • Invoice Appointments
    • GET Single Invoice Appointment
    • Edit Invoice Appointments
    • Delete Invoice Appointments
    • GET All Invoice Appointments
    • Add New Invoice Appointment
  • Estimate Appointments
    • GET Single Estimate Appointment
    • Edit Estimate Appointments
    • Delete Estimate Appointments
    • GET All Estimate Appointments
    • Add New Estimate Appointment
  • Work Order Appointments
    • GET Single Work Order Appointment
    • Edit Work Order Appointments
    • Delete Work Order Appointments
    • GET All Work Order Appointments
    • Add New Work Order Appointment
  • Notes
    • GET Single Note
    • Edit Notes
    • Delete Notes
    • GET All Notes
    • Add New Note
  • Time Tracking
    • GET Single Time Tracking
    • Edit Time Tracking
    • Delete Time Tracking
    • GET All Time Tracking
    • Add New Time Tracking
  • Invoice Payments
    • GET Single Invoice Payment
    • Edit Invoice Payments
    • Delete Invoice Payments
    • GET All Invoice Payments
    • Add New Invoice Payment
  • Client Payments
    • GET Single Client Payment
    • Edit Client Payments
    • Delete Client Payments
    • GET All Client Payments
    • Add New Client Payment
  • Products
    • GET Single Product
    • Edit Products
    • Delete Products
    • GET All Products
    • Add New Product
  • Journals
    • GET Single Journal
    • Edit Journals
    • Delete Journals
    • GET All Journals
    • Add New Journal
  • Journal Accounts
    • GET Single Journal Account
    • Edit Journal Accounts
    • Delete Journal Accounts
    • GET All Journal Accounts
    • Add New Journal Account
  • Journal Cats
    • GET Single Journal Cat
    • Edit Journal Cats
    • Delete Journal Cats
    • GET All Journal Cats
    • Add New Journal Cat
  • Expenses
    • GET Single Expens
    • Edit Expenses
    • Delete Expenses
    • GET All Expenses
    • Add New Expens
  • Incomes
    • GET Single Income
    • Edit Incomes
    • Delete Incomes
    • GET All Incomes
    • Add New Income
  • Taxes
    • GET Single Taxe
    • Edit Taxes
    • Delete Taxes
    • GET All Taxes
    • Add New Taxe
  • Purchase Invoices
    • GET Single Purchase Invoice
    • Edit Purchase Invoices
    • Delete Purchase Invoices
    • GET All Purchase Invoices
    • Add New Purchase Invoice
  • Purchase Refunds
    • GET Single Purchase Refund
      GET
    • Edit Purchase Refunds
      PUT
    • Delete Purchase Refunds
      DELETE
    • GET All Purchase Refunds
      GET
    • Add New Purchase Refund
      POST
  • Stock Transactions
    • GET Single Stock Transaction
    • Edit Stock Transactions
    • Delete Stock Transactions
    • GET All Stock Transactions
    • Add New Stock Transaction
  • Stores
    • GET Single Store
    • Edit Stores
    • Delete Stores
    • GET All Stores
    • Add New Store
  • Product Categories
    • GET Single Product Category
    • GET All Product Categories
  • Staff
    • GET Single Staff
    • GET All Staff
  • Client-attendance-log
    • Add New Client-attendance-log
  • Follow Up Actions
    • GET Single Follow Up Action
    • Delete Follow Up Action
    • GET All Follow Up Actions
  • Follow Up Statuses
    • GET Single Follow Up Status
    • Delete Follow Up Status
    • GET All Follow Up Statuses
  • General Listing
    • GET General Listing
  • Site
    • GET Site Info
  • Treasuries
    • GET Single Treasury
    • Edit Treasuries
    • Delete Treasuries
    • GET All Treasuries
    • Add New Treasury
  1. Purchase Refunds

Add New Purchase Refund

Production
https://{{subdomain}}.daftra.com/api2
Production
https://{{subdomain}}.daftra.com/api2
POST
https://{{subdomain}}.daftra.com/api2
/purchase_refunds{format}
Purchase Refunds
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://.daftra.com/api2/purchase_refunds' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'apikey: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "PurchaseRefund": {
        "id": 98,
        "staff_id": 0,
        "no": "987",
        "supplier_id": 0,
        "is_offline": true,
        "currency_code": "USD",
        "supplier_business_name": "string",
        "supplier_first_name": "string",
        "supplier_last_name": "string",
        "supplier_email": "user@example.com",
        "supplier_address1": "string",
        "supplier_address2": "string",
        "supplier_postal_code": "string",
        "supplier_city": "string",
        "supplier_state": "string",
        "supplier_country_code": "str",
        "date": "2019-08-24",
        "draft": true,
        "Supplier_active_secondary_address": true,
        "Supplier_secondary_country_code": "string",
        "Supplier_secondary_name": "string",
        "Supplier_secondary_address1": "string",
        "Supplier_secondary_address2": "string",
        "Supplier_secondary_city": "string",
        "Supplier_secondary_state": "string",
        "Supplier_secondary_postal_code": "string",
        "is_received": true,
        "received_date": "2019-10-30 12:59:30"
    },
    "PurchaseOrderItem": [
        {
            "product_id": 0,
            "org_name": "string",
            "description": "string",
            "unit_price": 0,
            "quantity": 0,
            "tax1": 0,
            "tax2": 0,
            "purchase_order_id": 0,
            "item": "string",
            "col_3": null,
            "col_4": null,
            "col_5": null,
            "discount": 0,
            "discount_type": "1 => Percentage",
            "store_id": "The Purchase Order store id"
        }
    ]
}'
Response Response Example
202 - Example 1
{
  "code": 202,
  "result": "successful",
  "id": "2415"
}

Request

Path Params
format
string 
required
Header Params
Accept
string 
optional
Default:
application/json
Content-Type
string 
optional
Default:
application/json
Authorization
string 
optional
You can generate the bearer token using the the authorization endpoint then use it here to be able to operate over your account's data
Default:
Bearer {{access_token}}
apikey
string 
deprecated
You can find/generate your apikey(s) from inside your Daftra Account
Default:
{{apikey}}
Body Params application/json
PurchaseRefund
object 
PurchaseOrderBase
optional
id
integer <int64>
optional
Unique Identifier
Example:
98
staff_id
integer <int32>
optional
Staff user submitting the request
no
string 
optional
Purchase invoice user identifier
<= 255 characters
Example:
987
supplier_id
integer <int64>
optional
Supplier REF#, you can get it through the Suppliers API
is_offline
boolean 
optional
0 : if it is an online order / 1 : if it is an offline order
currency_code
string 
optional
3 Digit currency code following ISO 4217 standard
<= 3 characters
Example:
USD
supplier_business_name
string 
optional
Supplier business name
<= 255 characters
supplier_first_name
string 
optional
Supplier first name
<= 255 characters
supplier_last_name
string 
optional
Supplier last name
<= 255 characters
supplier_email
string <email>
optional
Supplier email
<= 255 characters
supplier_address1
string 
optional
Supplier address line 1
<= 255 characters
supplier_address2
string 
optional
Supplier address line 2
<= 255 characters
supplier_postal_code
string 
optional
Supplier postal code
<= 10 characters
supplier_city
string 
optional
Supplier City
<= 100 characters
supplier_state
string 
optional
Supplier State
<= 100 characters
supplier_country_code
string 
optional
Supplier Country code
<= 3 characters
date
string <date>
optional
Date of the purchase invoice
draft
boolean 
optional
1 : if it is only a draft and doesn't affect the stock, 0 : not a draft and will affect the stock
Supplier_active_secondary_address
boolean 
optional
Supplier_secondary_country_code
string 
optional
Supplier 2 country code
<= 255 characters
Supplier_secondary_name
string 
optional
Supplier 2 name
<= 255 characters
Supplier_secondary_address1
string 
optional
Supplier 2 address line 1
<= 255 characters
Supplier_secondary_address2
string 
optional
Supplier 2 address line 2
<= 255 characters
Supplier_secondary_city
string 
optional
Supplier 2 City
<= 255 characters
Supplier_secondary_state
string 
optional
Supplier 2 State
<= 255 characters
Supplier_secondary_postal_code
string 
optional
Supplier 2 Postal code
<= 255 characters
is_received
boolean 
optional
0: the supplies are not received /1 the supplies are received
received_date
string <date-time>
optional
Date for when it was received
Example:
2019-10-30 12:59:30
PurchaseOrderItem
array [object {15}] 
optional
product_id
integer <int32>
optional
Product Ref #
org_name
string <>
optional
Name of the category that this item is following
description
string <>
optional
Description of the item
unit_price
number <double>
optional
Unit price of the item
quantity
integer <int32>
optional
Quantity of the item in the order
tax1
number <double>
optional
Tax 1 value applied on this item
tax2
number <double>
optional
Tax 2 value applied on this item
purchase_order_id
integer 
optional
Purchase Order Ref #
item
string 
optional
Name of the product
col_3
string  | null 
optional
additional data to be appear in the Purchase Order layout
Default:
null
col_4
string  | null 
optional
additional data to be appear in the Purchase Order layout
Default:
null
col_5
string  | null 
optional
additional data to be appear in the Purchase Order layout
Default:
null
discount
number <double>
optional
discount amount
discount_type
enum<integer> 
optional
discount type
Allowed values:
1 => Percentage2 => Absolute
store_id
integer <int64>
optional
The store which this item belongs to get it from GET STORE API if it's not set the Purchase Order store is used
Default:
The Purchase Order store id
Example:
0
Examples

Responses

🟢202Accepted
application/json
Created
Body
code
integer 
optional
Example:
202
result
string 
optional
Example:
successful
id
integer 
optional
Example:
2415
🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
Previous
GET All Purchase Refunds
Next
GET Single Stock Transaction